+static int process_config_includes(struct conf_config *config, xmlNode *n);
+
+static int config_include_one(struct conf_config *config, xmlNode **sib,
+ const char *path)
+{
+ struct stat st;
+ if (stat(path, &st) < 0)
+ {
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "stat %s", path);
+ return -1;
+ }
+ else
+ {
+ if (S_ISREG(st.st_mode))
+ {
+ xmlDoc *doc = xmlParseFile(path);
+ yaz_log(YLOG_LOG, "processing include path=%s", path);
+ if (doc)
+ {
+ xmlNodePtr t = xmlDocGetRootElement(doc);
+ int ret = process_config_includes(config, t);
+ *sib = xmlAddNextSibling(*sib, xmlCopyNode(t, 1));
+ xmlFreeDoc(doc);
+ if (ret)
+ return -1;
+ }
+ else
+ {
+ yaz_log(YLOG_FATAL, "Could not parse %s", path);
+ return -1;
+ }
+ }
+ }
+ return 0;
+}
+
+static int config_include_src(struct conf_config *config, xmlNode **np,
+ const char *src)