const char *cf_pair_filename(CONF_PAIR *pair);
const char *cf_section_filename(CONF_SECTION *section);
CONF_ITEM *cf_item_find_next(CONF_SECTION *section, CONF_ITEM *item);
+CONF_SECTION *cf_item_parent(CONF_ITEM *ci);
int cf_item_is_section(CONF_ITEM *item);
int cf_item_is_pair(CONF_ITEM *item);
CONF_PAIR *cf_itemtopair(CONF_ITEM *item);
}
}
+CONF_SECTION *cf_item_parent(CONF_ITEM *ci)
+{
+ if (!ci) return NULL;
+
+ return ci->parent;
+}
+
int cf_section_lineno(CONF_SECTION *section)
{
return cf_sectiontoitem(section)->lineno;
* codes.
*/
} else {
+ CONF_SECTION *loop;
CONF_PAIR *cp = cf_itemtopair(ci);
modrefname = cf_pair_attr(cp);
if (cs) subcs = cf_section_sub_find_name2(cs, NULL,
modrefname);
}
+
+ /*
+ * Allow policies to over-ride module names.
+ * i.e. the "sql" policy can do some extra things,
+ * and then call the "sql" module.
+ */
+ for (loop = cf_item_parent(ci);
+ loop && subcs;
+ loop = cf_item_parent(cf_sectiontoitem(loop))) {
+ if (loop == subcs) {
+ subcs = NULL;
+ }
+ }
+
if (subcs) {
DEBUG2(" Module: Loading virtual module %s",
modrefname);