|
Crinit -- Configurable Rootfs Init
|
Implementation of the Config Parser. More...
#include "confparse.h"#include <ctype.h>#include <stdlib.h>#include <string.h>#include "common.h"#include "confconv.h"#include "confmap.h"#include "elosdep.h"#include "envset.h"#include "globopt.h"#include "ini.h"#include "ioredir.h"#include "lexers.h"#include "logio.h"
Data Structures | |
| struct | crinitIniParserCtx_t |
Functions | |
| static int | crinitIniHandler (void *parserCtx, const char *section, const char *name, const char *value) |
| int | crinitParseConf (crinitConfKvList_t **confList, const char *filename) |
| void | crinitFreeConfList (crinitConfKvList_t *confList) |
| void | crinitFreeArgvArray (char **inArgv) |
| int | crinitLoadSeriesConf (const char *filename) |
| int | crinitLoadTasks (crinitFileSeries_t *series) |
Implementation of the Config Parser.
| void crinitFreeArgvArray | ( | char ** | inArgv | ) |
Frees a string array with a backing string.
| inArgv | The string array to free, must be a double pointer with 2 allocations, one array of pointers and a single inner array of char. |
| void crinitFreeConfList | ( | crinitConfKvList_t * | confList | ) |
Frees memory allocated for an crinitConfKvList_t by crinitParseConf().
| confList | Pointer to crinitConfKvList_t allocated by crinitParseConf() and not freed before. If confList is NULL, crinitFreeConfList() will return without freeing any memory. |
|
static |
Parser handler for libinih.
| int crinitLoadSeriesConf | ( | const char * | filename | ) |
Parse a series file.
Will return the task config and include files to be loaded in series. Will also set any global options specified in the series file.
| filename | The path to the series file to load. |
| int crinitLoadTasks | ( | crinitFileSeries_t * | series | ) |
Load all tasks related to a series file.
| series | Returns the paths to the task configs specified in the series file (or scanned from TASKDIR, if configured). |
| int crinitParseConf | ( | crinitConfKvList_t ** | confList, |
| const char * | filename | ||
| ) |
Parse a config file into a crinitConfKvList_t.
Parses a config file and fills confList. Items of confList are dynamically allocated (grown) and need to be freed using free_confList(). The format of the config file is expected to be KEY1=VALUE1<newline>KEY2=VALUE2<newline>... Lines beginning with # are considered comments.
If the Kernel command line option crinit.signatures is set to yes, this function will also check the configuration file's signature. A non-matching signature is handled as a parser error.
| confList | will return a pointer to dynamically allocated memory of a ConfKvList filled with the key/value-pairs from the config file. |
| filename | Path to the configuration file. |