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
35d5f56a
Commit
35d5f56a
authored
Oct 11, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: allow per-arch and per-extension config lines
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
f801278e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
conf.c
lib/conf.c
+21
-2
No files found.
lib/conf.c
View file @
35d5f56a
...
...
@@ -119,7 +119,7 @@ static struct pp_argname arg_ext[] = {
{},
};
static
struct
pp_argline
arglines
[]
=
{
static
struct
pp_argline
pp_global_
arglines
[]
=
{
{
f_port
,
"port"
,
ARG_STR
},
{
f_port
,
"link"
,
ARG_STR
},
/* old name for "port" */
{
f_if
,
"iface"
,
ARG_STR
},
...
...
@@ -132,6 +132,14 @@ static struct pp_argline arglines[] = {
{}
};
/* Provide default empty argument lines for architecture and extension */
struct
pp_argline
pp_arch_arglines
[]
__attribute__
((
weak
))
=
{
{}
};
struct
pp_argline
pp_ext_arglines
[]
__attribute__
((
weak
))
=
{
{}
};
/* local implementation of isblank() for bare-metal users */
static
int
blank
(
int
c
)
{
...
...
@@ -181,9 +189,20 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
current_ppi
=
NULL
;
return
0
;
}
for
(
l
=
arglines
;
l
->
f
;
l
++
)
/* Look for the configuration keyword in global, arch, ext */
for
(
l
=
pp_global_arglines
;
l
->
f
;
l
++
)
if
(
!
strcmp
(
word
,
l
->
keyword
))
break
;
if
(
!
l
->
f
)
for
(
l
=
pp_arch_arglines
;
l
->
f
;
l
++
)
if
(
!
strcmp
(
word
,
l
->
keyword
))
break
;
if
(
!
l
->
f
)
for
(
l
=
pp_ext_arglines
;
l
->
f
;
l
++
)
if
(
!
strcmp
(
word
,
l
->
keyword
))
break
;
if
(
!
l
->
f
)
{
pp_diag
(
NULL
,
config
,
1
,
"line %i: no such keyword
\"
%s
\"\n
"
,
lineno
,
word
);
...
...
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