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.


that's the whole page, bestie β€” dated 2018-08-26, and yeah, it's configFileLoad(3). mwah πŸ’‹πŸ«Ά