X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Freclists.h;h=bc02f107e26939aae795e1e924e8c578caf5842c;hb=705f49b5a94dcdba10bba40a3f63d312ebbc054c;hp=f61615bf29c9a54709f67338b6bea11fe5b3b297;hpb=4d4deab1ab8bfec73a481ae43127687d13826146;p=pazpar2-moved-to-github.git diff --git a/src/reclists.h b/src/reclists.h index f61615b..bc02f10 100644 --- a/src/reclists.h +++ b/src/reclists.h @@ -1,7 +1,5 @@ -/* $Id: reclists.h,v 1.8 2007-04-20 13:03:22 marc Exp $ - Copyright (c) 2006-2007, Index Data. - -This file is part of Pazpar2. +/* This file is part of Pazpar2. + Copyright (C) 2006-2010 Index Data 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 @@ -14,30 +12,18 @@ 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. - */ +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ #ifndef RECLISTS_H #define RECLISTS_H -#include "config.h" +#include "pazpar2_config.h" #include "record.h" -struct reclist -{ - struct reclist_bucket **hashtable; - int hashtable_size; - int hashmask; - - struct record_cluster **flatlist; - int flatlist_size; - int num_records; - int pointer; - - NMEM nmem; -}; +struct reclist; // This is a recipe for sorting. First node in list has highest priority struct reclist_sortparms @@ -48,22 +34,30 @@ struct reclist_sortparms struct reclist_sortparms *next; }; -struct reclist *reclist_create(NMEM, int numrecs); -struct record_cluster *reclist_insert( struct reclist *tl, - struct conf_service *service, - struct record *record, - char *merge_key, int *total); +struct reclist *reclist_create(NMEM); +void reclist_destroy(struct reclist *l); +struct record_cluster *reclist_insert(struct reclist *tl, + struct conf_service *service, + struct record *record, + const 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); -struct reclist_sortparms *reclist_parse_sortparms(NMEM nmem, const char *parms); +void reclist_enter(struct reclist *l); +void reclist_leave(struct reclist *l); +struct reclist_sortparms *reclist_parse_sortparms(NMEM nmem, const char *parms, + struct conf_service *service); + +int reclist_get_num_records(struct reclist *l); +struct record_cluster *reclist_get_cluster(struct reclist *l, int i); #endif /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +