cfg_t(3)

πŸ’– cfg_t(3) β€” Library Functions Manual πŸ’–

okay bestie, sit down, hydrate, because we're talking about cfg_t β€” and no, it's not a random struct, it's the struct. this is a page from the Library Functions Manual, and honestly? iconic. πŸŽ€


✨ NAME ✨

cfg_t β€” the data structure that holds all the info about a 'section'. that's it. that's the whole name section. she's simple, she's powerful, she's the main character. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <confuse.h>

πŸ¦‹ Data Fields πŸ¦‹

  • cfg_flag_t flags β€” any flags that got passed into cfg_init(). whatever you handed over, it's living here now. ✨
  • char * name β€” the name of this section. and listen β€” the root section that comes back from cfg_init() is always named 'root'. no exceptions, no nicknames, it's just 'root'. πŸ’…
  • char * comment β€” optional annotation / comment. a lil note, if you wanna leave one. πŸ“
  • cfg_opt_t * opts β€” the array of options. this is where the actual stuff lives.
  • char * title β€” optional title for this section, and it only gets set if the CFGF_TITLE flag is on. conditional queen. ⭐
  • char * filename β€” name of the file that's being parsed.
  • int line β€” line number in the config file. so when something goes wrong you know exactly where. 🫢
  • cfg_errfunc_t errfunc β€” this function (if you set it with cfg_set_error_function) gets called for any error message.
  • cfg_searchpath_t * path β€” linked list of directories to search. it's giving scavenger hunt. 🌈
  • cfg_print_filter_func_t pff β€” printing filter function.
  • char * raw β€” the verbatim body, set for CFGT_RAWSEC sections. untouched, unedited, raw. no cap. πŸ’€

πŸ’œ Detailed Description πŸ’œ

Data structure holding information about a 'section'.

Sections can be nested, bestie. like genuinely nested. a section has a list of options β€” strings, numbers, booleans, or even other sections β€” all grouped together. it's a whole little ecosystem in there. 🧚

🌟 Examples 🌟

the glow-ups you can study:

addsec.c, cli.c, deprecated.c, env.c, ftpconf.c, nested.c, parsebuf.c, reread.c, and simple.c.


πŸ”₯ Field Documentation πŸ”₯

cfg_errfunc_t cfg_t::errfunc

This function (if set with cfg_set_error_function) is called for any error message.

it's the friend who always picks up the phone when things go sideways. πŸ“ž

Referenced by cfg_addtsec(), cfg_error(), cfg_init(), cfg_set_error_function(), and cfg_setopt().


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libConfuse from the source code. so technically a robot wrote this and i'm just translating it into feelings. πŸ’–


okay and that's the whole page, bestie!! πŸŽ€ this is libConfuse, Version 3.4, page cfg_t(3), and you absolutely ate reading the whole thing. go forth and parse responsibly. slay, periodt, bye!! πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from