struct cf_section cf_sections; // root section
struct cf_item *
-cf_find_subitem(struct cf_section *sec, byte *name)
+cf_find_subitem(struct cf_section *sec, const char *name)
{
struct cf_item *ci = sec->cfg;
for (; ci->cls; ci++)
}
void
-cf_declare_section(byte *name, struct cf_section *sec, uns allow_unknown)
+cf_declare_section(const char *name, struct cf_section *sec, uns allow_unknown)
{
if (!cf_sections.cfg)
{
}
void
-cf_init_section(byte *name, struct cf_section *sec, void *ptr, uns do_bzero)
+cf_init_section(const char *name, struct cf_section *sec, void *ptr, uns do_bzero)
{
if (do_bzero) {
ASSERT(sec->size);
}
}
if (sec->init) {
- byte *msg = sec->init(ptr);
+ char *msg = sec->init(ptr);
if (msg)
die("Cannot initialize section %s: %s", name, msg);
}
}
-static byte *
+static char *
commit_section(struct cf_section *sec, void *ptr, uns commit_all)
{
- byte *err;
+ char *err;
for (struct cf_item *ci=sec->cfg; ci->cls; ci++)
if (ci->cls == CC_SECTION) {
if ((err = commit_section(ci->u.sec, ptr + (uintptr_t) ci->ptr, commit_all))) {
- log(L_ERROR, "Cannot commit section %s: %s", ci->name, err);
+ msg(L_ERROR, "Cannot commit section %s: %s", ci->name, err);
return "commit of a subsection failed";
}
} else if (ci->cls == CC_LIST) {
uns idx = 0;
CLIST_FOR_EACH(cnode *, n, * (clist*) (ptr + (uintptr_t) ci->ptr))
if (idx++, err = commit_section(ci->u.sec, n, commit_all)) {
- log(L_ERROR, "Cannot commit node #%d of list %s: %s", idx, ci->name, err);
+ msg(L_ERROR, "Cannot commit node #%d of list %s: %s", idx, ci->name, err);
return "commit of a list failed";
}
}