DOKK / manpages / debian 11 / wofi / wofi-config.3.en
wofi-config(3) Library Functions Manual wofi-config(3)

wofi - Config functions and documentation

The functions documented here are used for manipulating maps that represent config entries. They are defined in config.h.

The following functions are used to work with configs.

Parses a single config line and inserts the result into the map

struct map* map - The map to insert into.

char* line - The config line to insert. Should be in the format of key=value.

Loads a config file into the given map

struct map* map - The map to load the config into.

const char* config - The path to a config file. Should contain lines with the format of key=value.

Gets a config entry, if the entry is not set then it returns def_opt.

struct map* config - The map to get the value from.

const char* key - The key to lookup.

char* def_opt - The default value to be returned if the key does not exist.

Gets an enum value from the config. If the value is not set then it returns def_opt.

struct map* config - The map to get the value from.

const char* key - The key to lookup.

char* def_opt - The default value to be returned if the key does not exist.

uint8_t num_choices - The number of enum options available.

varargs - The list of enum options available.