Refactor: hide reclist structure
[pazpar2-moved-to-github.git] / src / reclists.h
index 4ccef8f..fcf5919 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of Pazpar2.
-   Copyright (C) 2006-2008 Index Data
+   Copyright (C) 2006-2009 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
@@ -20,22 +20,10 @@ 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
@@ -70,14 +58,20 @@ struct record_cluster *reclist_insert( struct reclist *tl,
 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);
+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
  */
+