Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
11cd7eaf
Commit
11cd7eaf
authored
9 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Removed private static functions, prefixed constants with PARSER_ and changed name in copyright.
parent
653193b8
No related branches found
No related tags found
1 merge request
!129
Parameter file
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/parser.h
+10
-15
10 additions, 15 deletions
src/parser.h
with
10 additions
and
15 deletions
src/parser.h
+
10
−
15
View file @
11cd7eaf
/*******************************************************************************
/*******************************************************************************
* This file is part of SWIFT.
* This file is part of SWIFT.
* Copyright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk)
* Copyright (c) 2016 James Willis (james.s.willis@durham.ac.uk)
* 2015 Matthieu Schaller (matthieu.schaller@durham.ac.uk)
*
*
* This program is free software: you can redistribute it and/or modify
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* it under the terms of the GNU Lesser General Public License as published
...
@@ -22,21 +21,21 @@
...
@@ -22,21 +21,21 @@
#include
<stdio.h>
#include
<stdio.h>
#define MAX_LINE_SIZE 128
#define
PARSER_
MAX_LINE_SIZE 128
#define MAX_NO_OF_PARAMS 512
#define
PARSER_
MAX_NO_OF_PARAMS 512
#define COMMENT_CHAR "#"
#define
PARSER_
COMMENT_CHAR "#"
#define VALUE_CHAR ':'
#define
PARSER_
VALUE_CHAR ':'
#define VALUE_STRING ":"
#define
PARSER_
VALUE_STRING ":"
#define END_OF_FILE "..."
#define
PARSER_
END_OF_FILE "..."
struct
parameter
{
struct
parameter
{
char
name
[
MAX_LINE_SIZE
];
char
name
[
PARSER_
MAX_LINE_SIZE
];
char
value
[
MAX_LINE_SIZE
];
char
value
[
PARSER_
MAX_LINE_SIZE
];
};
};
struct
swift_params
{
struct
swift_params
{
struct
parameter
data
[
MAX_NO_OF_PARAMS
];
struct
parameter
data
[
PARSER_
MAX_NO_OF_PARAMS
];
int
count
;
int
count
;
};
};
...
@@ -48,8 +47,4 @@ void parser_get_param_float(struct swift_params *params, char *name, float *retP
...
@@ -48,8 +47,4 @@ void parser_get_param_float(struct swift_params *params, char *name, float *retP
void
parser_get_param_double
(
struct
swift_params
*
params
,
char
*
name
,
double
*
retParam
);
void
parser_get_param_double
(
struct
swift_params
*
params
,
char
*
name
,
double
*
retParam
);
void
parser_get_param_string
(
struct
swift_params
*
params
,
char
*
name
,
char
*
retParam
);
void
parser_get_param_string
(
struct
swift_params
*
params
,
char
*
name
,
char
*
retParam
);
/* Private functions. */
static
void
parse_line
(
FILE
*
fp
,
struct
swift_params
*
params
);
static
int
count_char
(
char
*
str
,
char
val
);
#endif
/* SWIFT_PARSER_H */
#endif
/* SWIFT_PARSER_H */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment