conf_get_fname takes conf_config as arg
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 23 Apr 2010 11:34:42 +0000 (13:34 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 23 Apr 2010 11:34:42 +0000 (13:34 +0200)
conf_get_fname takes conf_config rather than conf_service as argument.
This function is used by the normalize_record system.

src/normalize_cache.c
src/normalize_cache.h
src/normalize_record.c
src/normalize_record.h
src/pazpar2_config.c
src/pazpar2_config.h
src/session.c

index ee10186..e99f576 100644 (file)
@@ -56,7 +56,7 @@ normalize_cache_t normalize_cache_create(void)
 }
 
 normalize_record_t normalize_cache_get(normalize_cache_t nc,
 }
 
 normalize_record_t normalize_cache_get(normalize_cache_t nc,
-                                       struct conf_service *service,
+                                       struct conf_config *conf,
                                        const char *spec)
 {
     normalize_record_t nt;
                                        const char *spec)
 {
     normalize_record_t nt;
@@ -70,7 +70,7 @@ normalize_record_t normalize_cache_get(normalize_cache_t nc,
         nt = ci->nt;
     else
     {
         nt = ci->nt;
     else
     {
-        nt = normalize_record_create(service, spec);
+        nt = normalize_record_create(conf, spec);
         if (nt)
         {
             ci = nmem_malloc(nc->nmem, sizeof(*ci));
         if (nt)
         {
             ci = nmem_malloc(nc->nmem, sizeof(*ci));
index a076e32..09b0c48 100644 (file)
@@ -26,7 +26,7 @@ typedef struct normalize_cache_s *normalize_cache_t;
 normalize_cache_t normalize_cache_create(void);
 
 normalize_record_t normalize_cache_get(normalize_cache_t nc,
 normalize_cache_t normalize_cache_create(void);
 
 normalize_record_t normalize_cache_get(normalize_cache_t nc,
-                                       struct conf_service *service,
+                                       struct conf_config *conf,
                                        const char *spec);
 void normalize_cache_destroy(normalize_cache_t nc);
 
                                        const char *spec);
 void normalize_cache_destroy(normalize_cache_t nc);
 
index 6a2ab5e..fa39da2 100644 (file)
@@ -45,7 +45,7 @@ struct normalize_record_s {
     NMEM nmem;
 };
 
     NMEM nmem;
 };
 
-normalize_record_t normalize_record_create(struct conf_service *service,
+normalize_record_t normalize_record_create(struct conf_config *conf,
                                            const char *spec)
 {
     NMEM nmem = nmem_create();
                                            const char *spec)
 {
     NMEM nmem = nmem_create();
@@ -60,7 +60,7 @@ normalize_record_t normalize_record_create(struct conf_service *service,
     nmem_strsplit(nt->nmem, ",", spec, &stylesheets, &num);
     for (i = 0; i < num; i++)
     {
     nmem_strsplit(nt->nmem, ",", spec, &stylesheets, &num);
     for (i = 0; i < num; i++)
     {
-        WRBUF fname = conf_get_fname(service, stylesheets[i]);
+        WRBUF fname = conf_get_fname(conf, stylesheets[i]);
         
         *m = nmem_malloc(nt->nmem, sizeof(**m));
         (*m)->marcmap = NULL;
         
         *m = nmem_malloc(nt->nmem, sizeof(**m));
         (*m)->marcmap = NULL;
index 2ef4824..a928d78 100644 (file)
@@ -21,9 +21,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define NORMALIZE_RECORD_H
 typedef struct normalize_record_s *normalize_record_t;
 
 #define NORMALIZE_RECORD_H
 typedef struct normalize_record_s *normalize_record_t;
 
-struct conf_service;
+struct conf_config;
 
 
-normalize_record_t normalize_record_create(struct conf_service *service,
+normalize_record_t normalize_record_create(struct conf_config *conf,
                                            const char *spec);
 
 void normalize_record_destroy(normalize_record_t nt);
                                            const char *spec);
 
 void normalize_record_destroy(normalize_record_t nt);
index 094d7fe..ec87caf 100644 (file)
@@ -840,9 +840,8 @@ static struct conf_server *server_create(struct conf_config *config,
     return server;
 }
 
     return server;
 }
 
-WRBUF conf_get_fname(struct conf_service *service, const char *fname)
+WRBUF conf_get_fname(struct conf_config *config, const char *fname)
 {
 {
-    struct conf_config *config = service->server->config;
     WRBUF w = wrbuf_alloc();
 
     conf_dir_path(config, w, fname);
     WRBUF w = wrbuf_alloc();
 
     conf_dir_path(config, w, fname);
index 678e2e9..9e8f13d 100644 (file)
@@ -175,7 +175,7 @@ int config_start_listeners(struct conf_config *conf,
 
 void config_stop_listeners(struct conf_config *conf);
 
 
 void config_stop_listeners(struct conf_config *conf);
 
-WRBUF conf_get_fname(struct conf_service *service, const char *fname);
+WRBUF conf_get_fname(struct conf_config *config, const char *fname);
 
 #endif
 
 
 #endif
 
index 4653238..6327ba9 100644 (file)
@@ -359,7 +359,7 @@ static int prepare_map(struct session *se, struct session_database *sdb)
             }
         }
         sdb->map = normalize_cache_get(se->normalize_cache,
             }
         }
         sdb->map = normalize_cache_get(se->normalize_cache,
-                                       se->service, s);
+                                       se->service->server->config, s);
         if (!sdb->map)
             return -1;
     }
         if (!sdb->map)
             return -1;
     }