From: Marc Cromme Date: Tue, 17 Apr 2007 07:52:03 +0000 (+0000) Subject: changed order of arguments of reclist_insert such that struct reclist *tl X-Git-Tag: PAZPAR2.1.0.0~282 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=4bd52b143846801cd8d0d9a70c6cc2021132bd5f;p=pazpar2-moved-to-github.git changed order of arguments of reclist_insert such that struct reclist *tl now comes first, since this is the owner of the object member function --- diff --git a/src/logic.c b/src/logic.c index bfdaec1..d6a4e0b 100644 --- a/src/logic.c +++ b/src/logic.c @@ -1,4 +1,4 @@ -/* $Id: logic.c,v 1.3 2007-04-16 21:54:43 adam Exp $ +/* $Id: logic.c,v 1.4 2007-04-17 07:52:03 marc Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -699,7 +699,9 @@ static struct record *ingest_record(struct client *cl, Z_External *rec) xmlFree(mergekey); normalize_mergekey((char *) mergekey_norm, 0); - cluster = reclist_insert(global_parameters.server->service, se->reclist, res, (char *) mergekey_norm, + cluster = reclist_insert(se->reclist, + global_parameters.server->service, + 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 e0bf96d..4097e71 100644 --- a/src/reclists.c +++ b/src/reclists.c @@ -1,4 +1,4 @@ -/* $Id: reclists.c,v 1.10 2007-04-16 13:57:25 marc Exp $ +/* $Id: reclists.c,v 1.11 2007-04-17 07:52:03 marc Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -204,8 +204,8 @@ 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 conf_service *service, - struct reclist *l, +struct record_cluster *reclist_insert( struct reclist *l, + struct conf_service *service, struct record *record, char *merge_key, int *total) { @@ -216,6 +216,8 @@ struct record_cluster *reclist_insert( struct conf_service *service, assert(service); assert(service->num_metadata); assert(service->num_sortkeys); + assert(merge_key); + 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 9946712..b74373e 100644 --- a/src/reclists.h +++ b/src/reclists.h @@ -1,4 +1,4 @@ -/* $Id: reclists.h,v 1.6 2007-04-16 13:22:17 marc Exp $ +/* $Id: reclists.h,v 1.7 2007-04-17 07:52:03 marc Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -48,8 +48,8 @@ struct reclist_sortparms }; struct reclist *reclist_create(NMEM, int numrecs); -struct record_cluster *reclist_insert( struct conf_service *service, - struct reclist *tl, +struct record_cluster *reclist_insert( struct reclist *tl, + struct conf_service *service, struct record *record, char *merge_key, int *total); void reclist_sort(struct reclist *l, struct reclist_sortparms *parms);