jose_cfg(3)

πŸ’– jose_cfg(3) β€” JosΓ© Configuration πŸ’–

okay bestie, welcome to jose_cfg(3), the José Configuration page from the Library Functions Manual. this is where José keeps all its lil configuration settings, and honestly? it's giving "small API, big main character energy" ✨


🌸 NAME 🌸

jose_cfg β€” JosΓ© Configuration. that's it, that's the name, short and iconic πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

✨ Typedefs ✨

  • typedef jose_cfg_t jose_cfg_auto_t β€” defines a jose_cfg_t which calls jose_cfg_decref() at end of scope. it's the auto-cleanup bestie, she handles herself 🫢

✨ Functions ✨

  • jose_cfg_t * jose_cfg (void) β€” creates a new configuration instance. baby's first config 🌱
  • jose_cfg_t * jose_cfg_incref (jose_cfg_t *cfg) β€” increases the reference count of a configuration instance. more friends, more refs πŸ”₯
  • void jose_cfg_decref (jose_cfg_t *cfg) β€” decreases the reference count of a configuration instance. bye babe πŸ’€
  • void jose_cfg_set_err_func (jose_cfg_t *cfg, jose_cfg_err_t *err, void *misc) β€” sets the error handler function for this configuration instance. ✨
  • void * jose_cfg_get_err_misc (jose_cfg_t *cfg) β€” gets the miscellaneous data associated with the current error handler. πŸ”
  • void jose_cfg_err (jose_cfg_t *cfg, uint64_t err, const char *fmt,...) β€” submit an error. 🚨

πŸ¦‹ Detailed Description πŸ¦‹

JosΓ© Configuration. yes bestie, that's the whole detailed description. it's short but it ate πŸ’…


🌈 Typedef Documentation 🌈

typedef jose_cfg_t jose_cfg_auto_t

Defines a jose_cfg_t which calls jose_cfg_decref() at end of scope. for example:

void foo() {
    jose_cfg_auto_t *cfg = jose_cfg();
    // jose_cfg_decref() implicitly called
}

like??? she cleans up after herself automatically. no manual decref, no leaks, no stress. that's the vibe, iykyk 😌✨


πŸ‘‘ Function Documentation πŸ‘‘

jose_cfg_t* jose_cfg (void)

Creates a new configuration instance. brand new, fresh out the box, ready to be configured πŸŽ€

Returns:

  • A newly-allocated configuration instance. (yes queen, go allocate 🌸)

jose_cfg_t* jose_cfg_incref (jose_cfg_t * cfg)

Increases the reference count of a configuration instance. and the way that this function always succeeds? no failure path, no error checking needed, she just works πŸ’…

Parameters:

  • cfg β€” The configuration context.

Returns:

  • The value of cfg (for convenience). so you can chain it, cute right 🫢

void jose_cfg_decref (jose_cfg_t * cfg)

Decreases the reference count of a configuration instance. and when the reference count reaches zero, the configuration instance is freed. that's the moment she graduates, periodt πŸŽ“πŸ’€

Parameters:

  • cfg β€” The configuration context.

void jose_cfg_set_err_func (jose_cfg_t * cfg, jose_cfg_err_t * err, void * misc)

Sets the error handler function for this configuration instance. the value of misc will be passed to the error handler function. so like, whatever lil snack of data you wanna hand over, she'll carry it for you πŸ“

You may pass NULL to err to return to the default error handler. no cap, that's the reset button πŸ™ˆ

Parameters:

  • cfg β€” The configuration context.
  • err β€” The error handler function you wish to enable.
  • misc β€” The miscellaneous data you wish to pass to the error handler.

void* jose_cfg_get_err_misc (jose_cfg_t * cfg)

Gets the miscellaneous data associated with the current error handler. it's giving "where did i put that thing" and then finding it immediately πŸ”βœ¨

Parameters:

  • cfg β€” The configuration context.

Returns:

  • The miscellaneous data associated with the error handler.

void jose_cfg_err (jose_cfg_t * cfg, uint64_t err, const char * fmt, ...)

Submit an error. the error handler will be called with the error provided. like, you're literally handing the drama over to the handler and she deals with it πŸ’…

Parameters:

  • cfg β€” The configuration context (optional). πŸ‘€ note the optional bestie, she doesn't always need to be there
  • err β€” The number corresponding to this error type.
  • fmt β€” A printf()-style format string.
  • ... β€” The printf()-style arguments.

🌟 Author 🌟

Generated automatically by Doxygen for JosΓ© from the source code. so like, a robot wrote this and honestly? she ate πŸ€–πŸ’–


ok that's the whole page bestie, every function, every parameter, every return value, all of it, untouched. no facts were harmed in the making of this vibe check 🫢

and that's a wrap on jose_cfg(3) β€” brought to you by JosΓ©, dated Tue May 30 2017. iconic date, iconic library, slay πŸ’…βœ¨πŸŽ€