cfg_opt_t(3)

✨ NAME ✨

okay so bestie, this page is cfg_opt_t β€” the data structure that holds all the info about an option πŸ’– it's from the confuse library (libConfuse), manual page cfg_opt_t(3), and it's basically the lil' blueprint that tells libConfuse everything it needs to know about one option. iconic behavior, honestly.


🌸 SYNOPSIS 🌸

#include <confuse.h>

πŸŽ€ Data Fields

  • const char * name β€” the name of the option, bestie. like, its whole identity πŸ’…
  • char * comment β€” an optional comment/annotation, for when you wanna leave a lil' note 🫢
  • cfg_type_t type β€” the type of option πŸ‘‘
  • unsigned int nvalues β€” how many values actually got parsed πŸ”’
  • cfg_value_t ** values β€” array of the found values, all lined up and ready 🌈
  • cfg_flag_t flags β€” flags 🚩
  • cfg_opt_t * subopts β€” suboptions (this only applies to sections, so don't get it twisted) πŸ“‚
  • cfg_defvalue_t def β€” the default value ⭐
  • cfg_func_t func β€” function callback for CFGT_FUNC options πŸ”₯
  • cfg_simple_t simple_value β€” pointer to a user-specified variable where simple values get stored (these are the ones created with the CFG_SIMPLE_* initializers) πŸ’Ύ
  • cfg_callback_t parsecb β€” value parsing callback function 🧚
  • cfg_validate_callback_t validcb β€” value validating parsing callback function βœ…
  • cfg_validate_callback2_t validcb2 β€” value validating set callback function βœ…βœ¨
  • cfg_print_func_t pf β€” print callback function πŸ–¨οΈ
  • cfg_free_func_t freecb β€” user-defined memory release function, aka the cleanup crew 🧹

πŸ’– Detailed Description πŸ’–

so like, cfg_opt_t is the data structure holding information about an option. that's the whole vibe. it's the little container that knows everything about your option so you don't have to 🫢

and here's the tea: the value(s) are stored as an array of fundamental values β€” we're talking strings, numbers, etc. just the basics, no cap πŸ’…

πŸ¦‹ Examples

lowkey there are so many lil' example files to go look at, and they ate fr fr:

  • addsec.c
  • cli.c
  • deprecated.c
  • env.c
  • ftpconf.c
  • nested.c
  • parsebuf.c
  • reread.c
  • simple.c

πŸ‘‘ Author

Generated automatically by Doxygen for libConfuse from the source code. not me being auto-generated by a documentation tool, she's just like me fr πŸ˜­πŸ€–


and that's a wrap, bestie!! this page came to you courtesy of libConfuse, Version 3.4, and the manual page cfg_opt_t(3) πŸŽ€βœ¨ go forth and configure your options, main character πŸ’œ
πŸ“¦ where this page comes from