optionFileLoad(3)
π NAME π
okay so bestie, meet optionFileLoad(3) β she loads the locatable config files, in order. This page is from the Programmer's Manual, and she's here to make your -lopts life cute and correct. β¨
πΈ SYNOPSIS πΈ
#include <your-opts.h>
cc [...] -o outfile infile.c -lopts [...]
int optionFileLoad(tOptions * opts, char const * prog);
π¦ DESCRIPTION π¦
okay so this function is doing a whole two-pass main character moment. It looks in all the specified directories for a configuration file (an "rc" file or an "ini" file) and processes any found twice. π
First time through? Reverse order, bestie β last file first. On that pass, only "immediate action" configurables get processed. For example, if the last named file specifies not processing any more configuration files, then no more configuration files will be processed. Such an option in the first named directory will have no effect. π«Ά
Once the immediate action configurables have been handled, then the directories are handled in normal, forward order. In that way, later config files can override the settings of earlier config files. Slay. β¨
See the AutoOpts documentation for a thorough discussion of the config file format.
Configuration files not found or not decipherable are simply ignored. (Rude, but okay. π)
optsβ program options descriptorprogβ program name
π₯ RETURN VALUE π₯
0->SUCCESS-1->FAILURE
π ERRORS π
Returns the value, "-1" if the program options descriptor is out of date or indecipherable. Otherwise, the value "0" will always be returned.
π SEE ALSO π
The info documentation for the -lopts library.
Then the whole reference girl gang:
ao_string_tokenize(3)configFileLoad(3)optionFindNextValue(3)optionFindValue(3)optionFree(3)optionGetValue(3)optionLoadLine(3)optionMemberList(3)optionNextValue(3)optionOnlyUsage(3)optionPrintVersion(3)optionPrintVersionAndReturn(3)optionProcess(3)optionRestore(3)optionSaveFile(3)optionSaveState(3)optionUnloadNested(3)optionVersion(3)strequate(3)streqvcmp(3)streqvmap(3)strneqvcmp(3)strtransform(3)
mwah π β this cutie is from the Programmer's Manual, dated 2018-08-26, and the page is literally optionFileLoad(3). Stay slayed, bestie. π«Άπ
π¦ where this page comes from
- debian trixie: libopts25-dev 1:5.18.16-7 Β· GPL-3.0-or-later
- nixpkgs unstable: autogen 5.18.16
- ubuntu questing: libopts25-dev 1:5.18.16-7build1
- ubuntu resolute: libopts25-dev 1:5.18.16-7build2 Β· GPL-3.0-or-later
- ubuntu stonking: libopts25-dev 1:5.18.16-9 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms