*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
if ((entry = conf_get(key))) {
tdelete(entry, &conf, conf_cmp);
free(entry->key);
if ((entry = conf_get(key))) {
tdelete(entry, &conf, conf_cmp);
free(entry->key);
char key[256]={}, val[256]={}, fullkey[256]={};
FILE *fd = fopen(path, "rt");
if (!fd) return;
char key[256]={}, val[256]={}, fullkey[256]={};
FILE *fd = fopen(path, "rt");
if (!fd) return;
while (fgets(line, sizeof(line), fd)) {
/* Find special characters */
char *lbrace = strchr( line , '[');
while (fgets(line, sizeof(line), fd)) {
/* Find special characters */
char *lbrace = strchr( line , '[');
section, strtrim(key));
if (!strchr(fullkey, ' ')) {
conf_set_str(fullkey, val);
section, strtrim(key));
if (!strchr(fullkey, ' ')) {
conf_set_str(fullkey, val);
conf_set_int(fullkey, 0);
else
conf_set_str(fullkey, trim);
conf_set_int(fullkey, 0);
else
conf_set_str(fullkey, trim);
int conf_get_int(const char *key, int def)
{
entry_t *entry = conf_get(key);
int conf_get_int(const char *key, int def)
{
entry_t *entry = conf_get(key);
const char *conf_get_str(const char *key, const char *def)
{
entry_t *entry = conf_get(key);
const char *conf_get_str(const char *key, const char *def)
{
entry_t *entry = conf_get(key);