34#define CONF_SYSTEM_DIR "/etc/ginnos"
35#define CONF_USER_DIR ".config/ginnos"
68const char *
conf_get(
const conf_t *conf,
const char *section,
const char *key,
69 const char *fallback);
86long conf_get_int(
const conf_t *conf,
const char *section,
const char *key,
long fallback);
112int conf_set(
conf_t *conf,
const char *section,
const char *key,
const char *value);
int conf_set_bool(conf_t *conf, const char *section, const char *key, bool value)
Definition conf.c:683
const char * conf_section(const conf_t *conf, int index)
the name of a section, to go through all of them: index 0, 1, ... until NULL.
Definition conf.c:473
int conf_save(const conf_t *conf)
write the user's file: to a new file, fsync, then rename over the old one, so a crash leaves the old ...
Definition conf.c:770
const char * conf_get(const conf_t *conf, const char *section, const char *key, const char *fallback)
a value.
Definition conf.c:446
bool conf_get_bool(const conf_t *conf, const char *section, const char *key, bool fallback)
true, yes, on, 1 / false, no, off, 0 (any letter case).
Definition conf.c:517
char * conf_user_text(const conf_t *conf)
the user's file as text, as conf_save writes it (for tests).
Definition conf.c:709
int conf_bad_lines(const conf_t *conf)
how many bad lines the two files had.
Definition conf.c:817
conf_t * conf_from_text(const char *system_text, const char *user_text)
settings from text in memory (for tests).
Definition conf.c:352
uint32_t conf_get_color(const conf_t *conf, const char *section, const char *key, uint32_t fallback)
a colour: rrggbb or rrggbbaa.
Definition conf.c:545
int conf_set_int(conf_t *conf, const char *section, const char *key, long value)
Definition conf.c:676
void conf_free(conf_t *conf)
Definition conf.c:436
int conf_set_color(conf_t *conf, const char *section, const char *key, uint32_t argb)
Definition conf.c:688
conf_t * conf_open(const char *name)
open the settings called name: /etc/ginnos/<name>.conf and ~/.config/ginnos/<name>....
Definition conf.c:421
conf_t * conf_load(const char *system_path, const char *user_path)
open two files.
Definition conf.c:366
int conf_set(conf_t *conf, const char *section, const char *key, const char *value)
set a user value.
Definition conf.c:602
int conf_unset(conf_t *conf, const char *section, const char *key)
remove the user's value, so the system value is used again.
Definition conf.c:699
long conf_get_int(const conf_t *conf, const char *section, const char *key, long fallback)
a whole number: decimal, or hexadecimal with 0x.
Definition conf.c:500
struct conf conf_t
Definition conf.h:37
unsigned int uint32_t
Definition fb.h:17
integer types of fixed width.