SHTK_CONFIG_LOAD(3)
πΈ 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
- nixos 26.05: shtk 1.7
- nixpkgs unstable: shtk 1.7
- Copyright 2014 Google Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms