From: Adam Dickmeiss Date: Fri, 23 Apr 2010 11:34:42 +0000 (+0200) Subject: conf_get_fname takes conf_config as arg X-Git-Tag: v1.4.0~20 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=111cd7b055fafeb0bf763b3d44ddccdf9515a144;p=pazpar2-moved-to-github.git conf_get_fname takes conf_config as arg conf_get_fname takes conf_config rather than conf_service as argument. This function is used by the normalize_record system. --- diff --git a/src/normalize_cache.c b/src/normalize_cache.c index ee10186..e99f576 100644 --- a/src/normalize_cache.c +++ b/src/normalize_cache.c @@ -56,7 +56,7 @@ 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) { normalize_record_t nt; @@ -70,7 +70,7 @@ normalize_record_t normalize_cache_get(normalize_cache_t nc, 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)); diff --git a/src/normalize_cache.h b/src/normalize_cache.h index a076e32..09b0c48 100644 --- a/src/normalize_cache.h +++ b/src/normalize_cache.h @@ -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, - struct conf_service *service, + struct conf_config *conf, const char *spec); void normalize_cache_destroy(normalize_cache_t nc); diff --git a/src/normalize_record.c b/src/normalize_record.c index 6a2ab5e..fa39da2 100644 --- a/src/normalize_record.c +++ b/src/normalize_record.c @@ -45,7 +45,7 @@ struct normalize_record_s { 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(); @@ -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++) { - 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; diff --git a/src/normalize_record.h b/src/normalize_record.h index 2ef4824..a928d78 100644 --- a/src/normalize_record.h +++ b/src/normalize_record.h @@ -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; -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); diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index 094d7fe..ec87caf 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -840,9 +840,8 @@ static struct conf_server *server_create(struct conf_config *config, 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); diff --git a/src/pazpar2_config.h b/src/pazpar2_config.h index 678e2e9..9e8f13d 100644 --- a/src/pazpar2_config.h +++ b/src/pazpar2_config.h @@ -175,7 +175,7 @@ int config_start_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 diff --git a/src/session.c b/src/session.c index 4653238..6327ba9 100644 --- a/src/session.c +++ b/src/session.c @@ -359,7 +359,7 @@ static int prepare_map(struct session *se, struct session_database *sdb) } } sdb->map = normalize_cache_get(se->normalize_cache, - se->service, s); + se->service->server->config, s); if (!sdb->map) return -1; }