summaryrefslogtreecommitdiffstats
path: root/discover/parser-utils.h
Commit message (Collapse)AuthorAgeFilesLines
* parsers: dynamically register parsersJeremy Kerr2013-04-291-6/+11
| | | | | | | | | | | | | | | Currently, we require all parsers to be defined in an array in parsers.c. This change removes this requirement, by introducting a register_parser() macro, which adds a constructor to register the parser with the core parser infrastructure. Because each parser no longer resolves an undefined symbol, we need to use a `ld -r` object for libparser, instead of using libtool, which creates a .a (and hence has no parsers included). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/types: Create common file for type definitionsJeremy Kerr2013-04-101-1/+1
| | | | | | | | | | | | The device and boot_option types are defined in pb-protocol.h, but aren't really specific to the procotol. This means a lot of non-messaging-related files are #including the protocol definitions unnecessarily. This change separates the types out into lib/types/types.h. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* Use static array for parsersGeoff Levand2012-03-161-4/+1
| | | | | | | | | Change the parser structure array implementation from using an array in a seperate parsers section to a static array of pointers in parser.c. Parser priority is now set by the position in the new parsers array. Signed-off-by: Geoff Levand <geoff@infradead.org>
* Split common routines from kboot parserGeoff Levand2009-03-301-0/+1
| | | | | | | | | | | | | | | | Pull out the common .conf file parsing logic from kboot-parser.c and into two new files parser-conf.h and parser-conf.c, and rework the kboot parser to use those common routines. The new common routines are based on a .conf file parser context struct conf_context. The specific parsers setup the context then call the main parsing entry routine conf_parse(). conf_parse() uses the context info to open and read .conf files and call parser specific callbacks to process name:value pairs and to add boot_option instances to the discover server. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use separate section for parsers arrayJeremy Kerr2009-01-021-0/+10
| | | | | | | Instead of hardcoding the array of parsers, use the linker to do the work for us. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Hook up parsers to device discoveryJeremy Kerr2009-01-021-0/+17
Iterate the parsers from the device handler on an add event. Initial change to just the kboot parser. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud