X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Freclists.c;h=ed5c0ec4f0da4c84fa93299848c56ac6816e2a3e;hb=197410f262777b4955b23be723afe80d5f63cf77;hp=a1e104c46ff84cde344c9ae575ee46f2f92025f4;hpb=8ca1269eac32c1ddc19d16dc4f74e9a1e3e0b8f9;p=pazpar2-moved-to-github.git diff --git a/src/reclists.c b/src/reclists.c index a1e104c..ed5c0ec 100644 --- a/src/reclists.c +++ b/src/reclists.c @@ -1,5 +1,22 @@ -/* - * $Id: reclists.c,v 1.7 2007-01-15 04:34:28 quinn Exp $ +/* $Id: reclists.c,v 1.12 2007-04-17 12:15:32 marc Exp $ + Copyright (c) 2006-2007, Index Data. + +This file is part of Pazpar2. + +Pazpar2 is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Pazpar2; see the file LICENSE. If not, write to the +Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ #include @@ -187,15 +204,23 @@ 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 reclist *l, + struct conf_service *service, + 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; + + assert(service); + assert(l); + assert(record); + assert(merge_key); + assert(total); bucket = hash((unsigned char*) merge_key) & l->hashmask; + for (p = &l->hashtable[bucket]; *p; p = &(*p)->next) { // We found a matching record. Merge them