wofi-config(3)

πŸ“¦
version 1.5.3 Β· 2 versions
  • 1.5.3 Β· alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.3 Β· debian bookworm, ubuntu jammy
, in alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– wofi-config(3) πŸ’–

okay bestie, welcome to the wofi-config(3) page from the Library Functions Manual β€” yes it's a manual page, no it's not boring, sit down, we're learning config functions together 🫢


✨ NAME ✨

wofi β€” Config functions and documentation πŸ’…


🌸 DESCRIPTION 🌸

so like, the functions we're about to talk about? they're the ones you use to mess with maps that represent config entries. that's the whole vibe. they live in config.h β€” no cap, that's where they're defined. πŸŽ€


πŸ‘‘ CONFIG FUNCTIONS πŸ‘‘

these are the functions you use to work with configs, and we're going through all of them, no skipping, periodt. πŸ’œ

  • 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 you're inserting into, bestie.
    • char* line β€” the config line you're inserting. it should be in the format of key=value, okay? that's the format. iykyk. πŸ’«
  • 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. it 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, and if the entry is not set then it returns def_opt. iconic behaviour honestly. πŸ‘‘
    • struct map* config β€” the map to get the value from.
    • const char* key β€” the key to look up πŸ”
    • char* def_opt β€” the default value to be returned if the key does not exist. your little safety net, we love her. 🫢
  • 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 look up πŸ”
    • char* def_opt β€” the default value to be returned if the key does not exist.
    • int num_choices β€” the number of enum options available, count them carefully bestie πŸ”’
    • varargs β€” the list of enum options available. yes, varargs. the little ... is doing a lot of work here and we respect it. πŸ’…

and that's the whole page!! every function, every parameter, every default β€” nothing got left behind, fr fr. πŸ¦‹

mwah πŸ’‹ β€” sent to you straight from the wofi-config(3) manual page, that's the source and the version, bestie. go slay some configs. πŸ’–βœ¨πŸŽ€