int no_threads;
WRBUF confdir;
+ char *path;
iochan_man_t iochan_man;
database_hosts_t database_hosts;
};
static void conf_dir_path(struct conf_config *config, WRBUF w, const char *src)
{
- if (config->confdir && wrbuf_len(config->confdir) > 0 &&
- !yaz_is_abspath(src))
+ char full_path[1024];
+ if (yaz_filepath_resolve(src, config->path,
+ wrbuf_len(config->confdir) > 0 ?
+ wrbuf_cstr(config->confdir) : ".",
+ full_path))
{
- wrbuf_printf(w, "%s/%s", wrbuf_cstr(config->confdir), src);
+ wrbuf_puts(w, full_path);
}
else
+ {
+ yaz_log(YLOG_WARN, "File not found: fname=%s path=%s base=%s", src,
+ config->path, wrbuf_cstr(config->confdir));
wrbuf_puts(w, src);
+ }
}
void service_destroy(struct conf_service *service)
|| !strcmp((const char *) n->name, "facet"))
{
- yaz_log(YLOG_FATAL, "No longer supported: <%s>", n->name);
- yaz_log(YLOG_LOG, "Use <icu_chain id=\"%s\">.. instead", n->name);
- return 0;
+ if (!service->charsets)
+ service->charsets = pp2_charset_fact_create();
+ if (pp2_charset_fact_define(service->charsets, n,
+ (const char *) n->name))
+ {
+ yaz_log(YLOG_FATAL, "ICU chain definition error");
+ return 0;
+ }
}
else if (!strcmp((const char *) n->name, (const char *) "metadata"))
{
|| !strcmp((const char *) n->name, "mergekey")
|| !strcmp((const char *) n->name, "facet"))
{
- yaz_log(YLOG_FATAL, "No longer supported: <%s>", n->name);
- yaz_log(YLOG_LOG, "Use <icu_chain id=\"%s\">.. instead", n->name);
- return 0;
+ if (!server->charsets)
+ server->charsets = pp2_charset_fact_create();
+ if (pp2_charset_fact_define(server->charsets, n,
+ (const char *) n->name))
+ {
+ yaz_log(YLOG_FATAL, "ICU chain definition error");
+ return 0;
+ }
}
else if (!strcmp((const char *) n->name, "service"))
{
xmlFree(number);
}
}
+ else if (!strcmp((const char *) n->name, "file"))
+ {
+ xmlChar *path = xmlGetProp(n, (xmlChar *) "path");
+ if (path)
+ {
+ config->path = nmem_strdup(config->nmem, (const char *) path);
+ xmlFree(path);
+ }
+ }
else if (!strcmp((const char *) n->name, "targetprofiles"))
{
yaz_log(YLOG_FATAL, "targetprofiles unsupported here. Must be part of service");
config->nmem = nmem;
config->servers = 0;
+ config->path = nmem_strdup(nmem, ".");
config->no_threads = 0;
config->iochan_man = 0;
config->database_hosts = database_hosts_create();