Merge branch 'master' into paz-927
[pazpar2-moved-to-github.git] / src / pazpar2_config.c
index 4332397..82ce585 100644 (file)
@@ -55,7 +55,6 @@ struct conf_config
     int no_threads;
     WRBUF confdir;
     iochan_man_t iochan_man;
-    database_hosts_t database_hosts;
 };
 
 struct service_xslt
@@ -639,9 +638,14 @@ static struct conf_service *service_create_static(struct conf_server *server,
                  || !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"))
         {
@@ -859,7 +863,6 @@ static struct conf_server *server_create(struct conf_config *config,
     server->charsets = 0;
     server->http_server = 0;
     server->iochan_man = 0;
-    server->database_hosts = config->database_hosts;
     server->settings_fname = 0;
 
     if (server_id)
@@ -937,9 +940,14 @@ static struct conf_server *server_create(struct conf_config *config,
                  || !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"))
         {
@@ -1282,7 +1290,6 @@ struct conf_config *config_create(const char *fname, int verbose)
     config->servers = 0;
     config->no_threads = 0;
     config->iochan_man = 0;
-    config->database_hosts = database_hosts_create();
 
     config->confdir = wrbuf_alloc();
     if ((p = strrchr(fname,
@@ -1348,7 +1355,6 @@ void config_destroy(struct conf_config *config)
             struct conf_server *s_next = server->next;
             server_destroy(server);
             server = s_next;
-            database_hosts_destroy(&config->database_hosts);
         }
         wrbuf_destroy(config->confdir);
         nmem_destroy(config->nmem);