ECONF_SETVALUE(3)
π ECONF_SETVALUE(3) π
okay bestie, so this is a page from the libeconf Manual, and it's about the little family of functions that go by the collective name econf_set<type>Value β aka the glow-up crew that lets you set a value for a key inside a configuration file object. putting values in configs has never been this cunty, fr fr. π
β¨ NAME β¨
econf_set<type>Value β set a value for a key in a configuration file object π
π¦ SYNOPSIS π¦
#include <libeconf.h>
econf_err econf_setBoolValue(econf_file *kf, const char *group,
const char *key, bool value);
econf_err econf_setDoubleValue(econf_file *kf, const char *group,
const char *key, double value);
econf_err econf_setFloatValue(econf_file *kf, const char *group,
const char *key, float value);
econf_err econf_setIntValue(econf_file *kf, const char *group,
const char *key, int value);
econf_err econf_setInt64Value(econf_file *kf, const char *group,
const char *key, int64_t value);
econf_err econf_setUInt64Value(econf_file *kf, const char *group,
const char *key, uint64_t value);
econf_err econf_setStringValue(econf_file *kf, const char *group,
const char *key, const char *value);
econf_err econf_setValue(econf_file *kf, const char *group,
const char *key, const char *value);
bestie, that's eight whole functions and every single one of them is your new fav. π«Ά
πΈ DESCRIPTION πΈ
So the way this works: these functions set the value of a key inside the given configuration file object kf. you tell it where the key lives with group, and which key it is with key. iconic behaviour, truly.
major tea: if group is NULL, the key is considered to belong to none group. that's it, that's the vibe. no group, no drama.
If the key already exists, its value gets updated β like a glow-up in place. and if the key or the group doesn't exist yet? it gets created. not me manifesting new config entries out of thin air β¨
and here's the detail you need: the typed function econf_setBoolValue converts the given value into a string representation before storing it. so it takes your bool and gives it a little string costume before it goes in. π
π RETURN VALUE π
when everything's slaying and it all works out, these functions return ECONF_SUCCESS. main character energy only.
but if something goes wrong, you get a non-zero error code back instead (peep the next section, bestie β that's the section called βERRORSβ).
π ERRORS π
okay so here's the tea on what can go wrong, and what each little error code means:
ECONF_NOMEMβ not enough memory to allocate the new entry or group. the malloc said "i'm tired" πECONF_FILE_LIST_IS_NULLβ the conf file list isNULL. literally nothing there. the void. πECONF_EMPTYKEYβ the key isNULLor has an empty value. we need a name, bestie. πΈECONF_NOKEYβ key not found. it's not giving what it needs to give. πECONF_WRONG_BOOLEAN_VALUEβ wrong boolean value. the vibes allowed are1/0ortrue/falseoryes/no, and you gave it something else entirely. pick one that's actually on the list. π§
π SEE ALSO π
libeconf(3), econf_errString(3) π
aaand that's the whole page, bestie!! go set some values, you're gonna absolutely ate this. and just so we're keeping it β¨officialβ¨ β this page comes to you from libeconf, dated 2024-12-13, and yes it's still called ECONF_SETVALUE(3) at the top of every page like the icon it is. mwah, love u, bye!! πππ
πΈπ¦
π¦ where this page comes from
- alpine 3.23: libeconf-doc 0.8.3-r0 Β· MIT
- alpine 3.24: libeconf-doc 0.8.3-r0 Β· MIT
- nixpkgs unstable: libeconf 0.8.6
- ubuntu stonking: libeconf-dev 0.8.4+dfsg1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms