---
name: "wofi-config"
section: "3"
platform: "linux"
package: "wofi"
version: "1.5.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/wofi-config"
---

# wofi-config(3)

Config functions and documentation

## NAME

wofi - Config functions and documentation

## DESCRIPTION

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

## CONFIG FUNCTIONS

The following functions are used to work with configs.

- **void config\_put(struct map\* map, char\* line)**

  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*.

- **void config\_load(struct map\* map, const char\* config)**

  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*.

- **char\* config\_get(struct map\* config, const char\* key, char\* def\_opt)**

  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.

- **int config\_get\_mnemonic(struct map\* config, const char\* key, char\* def\_opt, int num\_choices, ...)**

  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.

  **int num\_choices** - The number of enum options available.

  **varargs** - The list of enum options available.
