Commit 35d5f56a authored by Alessandro Rubini's avatar Alessandro Rubini

config: allow per-arch and per-extension config lines

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent f801278e
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment