diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-03-12 15:30:41 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-04-29 13:55:50 +1000 |
commit | 39e06f5cfda0ed0c1eeb7a7604a3d05dda81ccf1 (patch) | |
tree | 559fa0f46f0ececa5db613c23d379083d8781624 | |
parent | 6276a57e76cf22aac639236d4782b56e2e5b9d5e (diff) | |
download | talos-petitboot-39e06f5cfda0ed0c1eeb7a7604a3d05dda81ccf1.tar.gz talos-petitboot-39e06f5cfda0ed0c1eeb7a7604a3d05dda81ccf1.zip |
parsers: Add filenames to struct parser
In preparation of moving file handling to the discover core (rather than
the parsers), include the conf file names in struct parser.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r-- | discover/grub2-parser.c | 6 | ||||
-rw-r--r-- | discover/kboot-parser.c | 6 | ||||
-rw-r--r-- | discover/parser.h | 5 | ||||
-rw-r--r-- | discover/yaboot-parser.c | 6 |
4 files changed, 18 insertions, 5 deletions
diff --git a/discover/grub2-parser.c b/discover/grub2-parser.c index fa7b950..6ef5945 100644 --- a/discover/grub2-parser.c +++ b/discover/grub2-parser.c @@ -188,4 +188,8 @@ static int grub2_parse(struct discover_context *dc) return rc; } -define_parser(grub2, grub2_parse); +struct parser __grub2_parser = { + .name = "grub2", + .parse = grub2_parse, + .filenames = grub2_conf_files, +}; diff --git a/discover/kboot-parser.c b/discover/kboot-parser.c index 5d5090b..c828e30 100644 --- a/discover/kboot-parser.c +++ b/discover/kboot-parser.c @@ -157,4 +157,8 @@ static int kboot_parse(struct discover_context *dc) return rc; } -define_parser(kboot, kboot_parse); +struct parser __kboot_parser = { + .name = "kboot", + .parse = kboot_parse, + .filenames = kboot_conf_files, +}; diff --git a/discover/parser.h b/discover/parser.h index 9f98368..c2f02d6 100644 --- a/discover/parser.h +++ b/discover/parser.h @@ -4,8 +4,9 @@ struct discover_context; struct parser { - char *name; - int (*parse)(struct discover_context *ctx); + char *name; + const char * const *filenames; + int (*parse)(struct discover_context *ctx); }; enum generic_icon_type { diff --git a/discover/yaboot-parser.c b/discover/yaboot-parser.c index b287817..0477d38 100644 --- a/discover/yaboot-parser.c +++ b/discover/yaboot-parser.c @@ -320,4 +320,8 @@ static int yaboot_parse(struct discover_context *dc) return rc; } -define_parser(yaboot, yaboot_parse); +struct parser __yaboot_parser = { + .name = "yaboot", + .parse = yaboot_parse, + .filenames = yaboot_conf_files, +}; |