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 descriptor
  • prog β€” 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:


mwah πŸ’‹ β€” this cutie is from the Programmer's Manual, dated 2018-08-26, and the page is literally optionFileLoad(3). Stay slayed, bestie. πŸ«ΆπŸ’–