configFileLoad(3)
πΈ NAME πΈ
okay so bestie, welcome to configFileLoad(3) β yes, that's the manual page name, and this whole thing lives in the Programmer's Manual. It's literally the routine that parses a configuration file, and it's kind of iconic. π
β¨ SYNOPSIS β¨
#include <your-opts.h>
cc [...] -o outfile infile.c -lopts [...]
const tOptionValue * configFileLoad(char const * fname);
π DESCRIPTION π
This routine will load a named configuration file and parse the text as a hierarchically valued option. No cap.
Vibe check: the option descriptor created from an option definition file is not used via this interface. Important.
The returned value is "named" with the input file name and is of type "OPARG_TYPE_HIERARCHY". It may be used in calls to optionGetValue(), optionNextValue() and optionUnloadNested(). Slay.
fnameβ the file to load. That's the whole assignment, bestie.
π RETURN VALUE π
An allocated, compound value structure. It's giving "here's your shiny hierarchy, go off." β¨
π ERRORS π
If the file cannot be loaded or processed, NULL is returned and errno is set. It may be set by a call to either open(2) mmap(2) or other file system calls, or it may be:
ENOENTβ the file was not found.ENOMSGβ the file was empty.EINVALβ the file contents are invalid -- not properly formed.ENOMEMβ not enough memory to allocate the needed structures.@end itemize
lowkey the @end itemize is just sitting there at the end of the original, so we're keeping it. periodt. π
π¦ SEE ALSO π¦
The info documentation for the -lopts library.
ao_string_tokenize(3)optionFileLoad(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)
that's the whole page, bestie β dated 2018-08-26, and yeah, it's configFileLoad(3). mwah ππ«Ά
π¦ 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