1wofi-config(3)             Library Functions Manual             wofi-config(3)
2
3
4

NAME

6       wofi - Config functions and documentation
7
8

DESCRIPTION

10       The  functions documented here are used for manipulating maps that rep‐
11       resent config entries. They are defined in config.h.
12
13

CONFIG FUNCTIONS

15       The following functions are used to work with configs.
16
17
18       void config_put(struct map* map, char* line)
19              Parses a single config line and inserts the result into the map
20
21              struct map* map - The map to insert into.
22
23              char* line - The config line to insert. Should be in the  format
24              of key=value.
25
26
27       void config_load(struct map* map, const char* config)
28              Loads a config file into the given map
29
30              struct map* map - The map to load the config into.
31
32              const  char*  config - The path to a config file. Should contain
33              lines with the format of key=value.
34
35
36       char* config_get(struct map* config, const char* key, char* def_opt)
37              Gets a config entry, if the entry is not  set  then  it  returns
38              def_opt.
39
40              struct map* config - The map to get the value from.
41
42              const char* key - The key to lookup.
43
44              char* def_opt - The default value to be returned if the key does
45              not exist.
46
47
48       uint8_t config_get_mnemonic(struct map* config, const char* key,  char*
49       def_opt, uint8_t num_choices, ...)
50              Gets an enum value from the config. If the value is not set then
51              it returns def_opt.
52
53              struct map* config - The map to get the value from.
54
55              const char* key - The key to lookup.
56
57              char* def_opt - The default value to be returned if the key does
58              not exist.
59
60              uint8_t num_choices - The number of enum options available.
61
62              varargs - The list of enum options available.
63
64
65
66                                                                wofi-config(3)
Impressum