From 5cc5bfa026237076ecb44ae016b78069edfcc492 Mon Sep 17 00:00:00 2001 From: Marc Cromme Date: Mon, 16 Apr 2007 13:22:17 +0000 Subject: [PATCH] removed global parameters from reclist_insert() --- src/logic.c | 4 ++-- src/reclists.c | 10 ++++++---- src/reclists.h | 8 +++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/logic.c b/src/logic.c index 501d5c8..1f61db6 100644 --- a/src/logic.c +++ b/src/logic.c @@ -1,4 +1,4 @@ -/* $Id: logic.c,v 1.1 2007-04-16 09:03:25 adam Exp $ +/* $Id: logic.c,v 1.2 2007-04-16 13:22:17 marc Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -700,7 +700,7 @@ static struct record *ingest_record(struct client *cl, Z_External *rec) xmlFree(mergekey); normalize_mergekey((char *) mergekey_norm, 0); - cluster = reclist_insert(se->reclist, res, (char *) mergekey_norm, + cluster = reclist_insert(global_parameters.server->service, se->reclist, res, (char *) mergekey_norm, &se->total_merged); if (global_parameters.dump_records) yaz_log(YLOG_LOG, "Cluster id %d from %s (#%d)", cluster->recid, diff --git a/src/reclists.c b/src/reclists.c index beee724..d27b69f 100644 --- a/src/reclists.c +++ b/src/reclists.c @@ -1,4 +1,4 @@ -/* $Id: reclists.c,v 1.8 2007-04-10 08:48:56 adam Exp $ +/* $Id: reclists.c,v 1.9 2007-04-16 13:22:17 marc Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -204,13 +204,15 @@ struct reclist *reclist_create(NMEM nmem, int numrecs) } // Insert a record. Return record cluster (newly formed or pre-existing) -struct record_cluster *reclist_insert(struct reclist *l, struct record *record, - char *merge_key, int *total) +struct record_cluster *reclist_insert( struct conf_service *service, + struct reclist *l, + struct record *record, + char *merge_key, int *total) { unsigned int bucket; struct reclist_bucket **p; struct record_cluster *cluster = 0; - struct conf_service *service = global_parameters.server->service; + /*struct conf_service *service = global_parameters.server->service;*/ bucket = hash((unsigned char*) merge_key) & l->hashmask; for (p = &l->hashtable[bucket]; *p; p = &(*p)->next) diff --git a/src/reclists.h b/src/reclists.h index 592dc22..9946712 100644 --- a/src/reclists.h +++ b/src/reclists.h @@ -1,4 +1,4 @@ -/* $Id: reclists.h,v 1.5 2007-04-10 08:48:56 adam Exp $ +/* $Id: reclists.h,v 1.6 2007-04-16 13:22:17 marc Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -48,8 +48,10 @@ struct reclist_sortparms }; struct reclist *reclist_create(NMEM, int numrecs); -struct record_cluster *reclist_insert(struct reclist *tl, struct record *record, - char *merge_key, int *total); +struct record_cluster *reclist_insert( struct conf_service *service, + struct reclist *tl, + struct record *record, + char *merge_key, int *total); void reclist_sort(struct reclist *l, struct reclist_sortparms *parms); struct record_cluster *reclist_read_record(struct reclist *l); void reclist_rewind(struct reclist *l); -- 1.7.10.4