SHTK_CONFIG_LOAD(3)

πŸ“¦ version 1.7, in nixos 26.05, nixpkgs unstable

🌸 SHTK_CONFIG_LOAD(3) 🌸

okay bestie, manual name check: this page lives in the Library Functions Manual, and it's giving "tiny but important config-loading icon" πŸ’…βœ¨


✨ NAME ✨

shtk_config_load β€” loads up a configuration file, periodt πŸ’–

🌈 LIBRARY 🌈

shtk_import config β€” that's the import line, iykyk 🫢

πŸŽ€ SYNOPSIS πŸŽ€

shtk_config_load config_file

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so shtk_config_load parses and loads the configuration file you hand it as config_file πŸ’«

The way this works: only the configuration variables you already registered as valid β€” by calling shtk_config_init(3) β€” get recognized as valid during the load. Any variables that the configuration file defines but that are not registered in the shtk_config_load module get ignored during the load πŸ™ˆ no cap.

🌸 EXAMPLES 🌸

Picture this configuration file, iconic:

prefix=/usr
OBJDIR="${prefix}/obj"
SRCDIR="${prefix}/src"

And here's the little code snippet that shows how to load and display the settings from that file above:

shtk_config_init OBJDIR SRCDIR
shtk_config_load ".../path/to/the/file/above.conf"

echo "prefix was defined but is not available:" \
    "$(shtk_config_get_default prefix default-value)"
echo "OBJDIR is $(shtk_config_get OBJDIR)"
echo "SRCDIR is $(shtk_config_get SRCDIR)"

πŸ’€ ERRORS πŸ’€

⚠️ if something errors out while config_file is being processed, the caller script gets terminated. literally done. 😭

πŸ‘‘ SEE ALSO πŸ‘‘

⭐ HISTORY ⭐

shtk_config_load first appeared in shtk 1.0 ✨ iconic behavior.


okay that's the page! source/version: Debian, date: November 6, 2014 β€” mwah πŸ’–πŸŽ€

πŸ“¦ where this page comes from