6main(
int argc,
char *argv[])
8 char *default_filename = SOURCE_DIR
"/examplerc";
9 char *filename_ptr = default_filename;
12 filename_ptr = argv[1];
16 fputs(
"This example program only accepts a single argument:\n\n", stderr);
17 fprintf(stderr,
"%s <config-file>\n\n", argv[0]);
37 while (config != NULL)
43 printf(
"Key: %s, Value: %s\n", config->key,
44 config->value != NULL ? config->value :
"NULL");
60 printf(
"Attribute: %s\n", attr);
Header file for the Canfigger configuration parser.
void canfigger_free_current_key_node_advance(struct Canfigger **list)
Frees the current key node and advances to the next node in the list.
struct Canfigger * canfigger_parse_file(const char *file, const int delimiter)
Parses a configuration file and creates a linked list of key-value pairs.
void canfigger_free_current_attr_str_advance(struct attributes *attributes, char **attr)
Frees the current attribute string and advances to the next attribute.
Structure to represent a key-value pair with attributes in the configuration.