cs);
if (!newp) return -1;
- ci = cf_pairtoitem(cp);
- cn = cf_pairtoitem(newp);
+ ci = &(cp->item);
+ cn = &(newp->item);
/*
* Find the old one from the linked list, and replace it
*/
if (!q[1]) {
if (!next) goto no_such_item;
- return cf_sectiontoitem(next);
+ return &(next->item);
}
q++; /* ensure we skip the ']' and '.' */
* section.
*/
cp = cf_pair_find(cs, p);
- if (cp) return cf_pairtoitem(cp);
+ if (cp) return &(cp->item);
next = cf_section_sub_find(cs, p);
- if (next) return cf_sectiontoitem(next);
+ if (next) return &(next->item);
/*
* "foo" is "in the current section, OR in main".
}
if (deprecated) {
- cf_log_err(cf_sectiontoitem(cs), "\"%s\" is deprecated. Please replace it with the up-to-date configuration", name);
+ cf_log_err(&(cs->item), "\"%s\" is deprecated. Please replace it with the up-to-date configuration", name);
if (check_config) {
return -1;
}
cs, buffer, sizeof(buffer),
value);
if (!value) {
- cf_log_err(cf_sectiontoitem(cs),"Failed expanding variable %s", name);
+ cf_log_err(&(cs->item),"Failed expanding variable %s", name);
return -1;
}
}
cpn = cf_pair_alloc(name, value, T_OP_SET, T_BARE_WORD, cs);
cpn->item.filename = "<internal>";
cpn->item.lineno = 0;
- cf_item_add(cs, cf_pairtoitem(cpn));
+ cf_item_add(cs, &(cpn->item));
}
return rcode;
cpn = cf_pair_alloc(buf1, value, t2, t3, this);
cpn->item.filename = filename;
cpn->item.lineno = *lineno;
- cf_item_add(this, cf_pairtoitem(cpn));
+ cf_item_add(this, &(cpn->item));
continue;
/*
filename, *lineno);
return -1;
}
- cf_item_add(this, cf_sectiontoitem(css));
+ cf_item_add(this, &(css->item));
css->item.filename = filename;
css->item.lineno = *lineno;
cp->item.filename = "internal";
cp->item.lineno = 0;
- cf_item_add(cs, cf_pairtoitem(cp));
+ cf_item_add(cs, &(cp->item));
if (cf_file_include(filename, cs) < 0) {
cf_section_free(&cs);
if (!section || !name1) return NULL;
- for (ci = cf_sectiontoitem(section); ci; ci = ci->next) {
+ for (ci = &(section->item); ci; ci = ci->next) {
if (ci->type != CONF_ITEM_SECTION)
continue;