Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
1055d869
Commit
1055d869
authored
Mar 12, 2016
by
Davide Ciminaghi
Committed by
Alessandro Rubini
Apr 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf.c: add an f_simple_int() config handler
Signed-off-by:
Davide Ciminaghi
<
ciminaghi@gnudd.com
>
parent
3e86c0a8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
ppsi.h
include/ppsi/ppsi.h
+2
-0
conf.c
lib/conf.c
+18
-0
No files found.
include/ppsi/ppsi.h
View file @
1055d869
...
...
@@ -319,6 +319,8 @@ extern struct pp_argline pp_ext_arglines[];
/* Note: config_string modifies the string it receives */
extern
int
pp_config_string
(
struct
pp_globals
*
ppg
,
char
*
s
);
extern
int
pp_config_file
(
struct
pp_globals
*
ppg
,
int
force
,
char
*
fname
);
extern
int
f_simple_int
(
struct
pp_argline
*
l
,
int
lineno
,
struct
pp_globals
*
ppg
,
union
pp_cfg_arg
*
arg
);
#define PPSI_PROTO_RAW 0
#define PPSI_PROTO_UDP 1
...
...
lib/conf.c
View file @
1055d869
...
...
@@ -63,6 +63,24 @@ static int f_port(struct pp_argline *l, int lineno, struct pp_globals *ppg,
return -1; \
}})
static
inline
void
ASSIGN_INT_FIELD
(
struct
pp_argline
*
l
,
struct
pp_globals
*
ppg
,
int
v
)
{
if
(
l
->
needs_port
)
*
(
int
*
)(((
void
*
)
CUR_PPI
(
ppg
))
+
l
->
field_offset
)
=
v
;
else
*
(
int
*
)(((
void
*
)
GOPTS
(
ppg
))
+
l
->
field_offset
)
=
v
;
}
int
f_simple_int
(
struct
pp_argline
*
l
,
int
lineno
,
struct
pp_globals
*
ppg
,
union
pp_cfg_arg
*
arg
)
{
CHECK_PPI
(
l
->
needs_port
);
ASSIGN_INT_FIELD
(
l
,
ppg
,
arg
->
i
);
return
0
;
}
static
int
f_if
(
struct
pp_argline
*
l
,
int
lineno
,
struct
pp_globals
*
ppg
,
union
pp_cfg_arg
*
arg
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment