From 4d4deab1ab8bfec73a481ae43127687d13826146 Mon Sep 17 00:00:00 2001 From: Marc Cromme Date: Fri, 20 Apr 2007 13:03:22 +0000 Subject: [PATCH] splitting record specific definition out from pazpar2.h header to record.h header, thus preparing for implementation of record constructors in the coming record.c file --- src/Makefile.am | 5 ++-- src/pazpar2.h | 38 ++++-------------------------- src/reclists.h | 3 ++- src/record.h | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 36 deletions(-) create mode 100644 src/record.h diff --git a/src/Makefile.am b/src/Makefile.am index 986317f..adf0bf5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.10 2007-04-20 10:06:52 adam Exp $ +# $Id: Makefile.am,v 1.11 2007-04-20 13:03:22 marc Exp $ bin_PROGRAMS = pazpar2 check_PROGRAMS = test_config test_relevance test_sel_thread @@ -12,7 +12,8 @@ AM_CFLAGS = $(YAZINC) libpazpar2_a_SOURCES = config.c config.h eventl.c eventl.h \ http.c http_command.c http_command.h http.h \ - logic.c pazpar2.h reclists.c reclists.h \ + logic.c pazpar2.h \ + record.h reclists.c reclists.h \ relevance.c relevance.h termlists.c termlists.h \ util.c util.h zeerex.c zeerex.h database.c database.h \ settings.h settings.c sel_thread.c sel_thread.h diff --git a/src/pazpar2.h b/src/pazpar2.h index d111196..2f5a4e2 100644 --- a/src/pazpar2.h +++ b/src/pazpar2.h @@ -1,4 +1,4 @@ -/* $Id: pazpar2.h,v 1.28 2007-04-20 04:32:33 quinn Exp $ +/* $Id: pazpar2.h,v 1.29 2007-04-20 13:03:22 marc Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -22,7 +22,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef PAZPAR2_H #define PAZPAR2_H -struct record; #include @@ -40,39 +39,9 @@ struct record; #include "eventl.h" #include "config.h" +struct record; struct client; -union data_types { - char *text; - struct { - int min; - int max; - } number; -}; - -struct record_metadata { - union data_types data; - struct record_metadata *next; // next item of this name -}; - -struct record { - struct client *client; - struct record_metadata **metadata; // Array mirrors list of metadata fields in config - union data_types **sortkeys; // Array mirrors list of sortkey fields in config - struct record *next; // Next in cluster of merged records -}; - -struct record_cluster -{ - struct record_metadata **metadata; // Array mirrors list of metadata fields in config - union data_types **sortkeys; - char *merge_key; - int relevance; - int *term_frequency_vec; - int recid; // Set-specific ID for this record - struct record *records; -}; - struct connection; // Represents a host (irrespective of databases) @@ -267,6 +236,9 @@ void start_zproxy(void); extern struct parameters global_parameters; void pazpar2_add_channel(IOCHAN c); void pazpar2_event_loop(void); + + + #endif /* diff --git a/src/reclists.h b/src/reclists.h index b74373e..f61615b 100644 --- a/src/reclists.h +++ b/src/reclists.h @@ -1,4 +1,4 @@ -/* $Id: reclists.h,v 1.7 2007-04-17 07:52:03 marc Exp $ +/* $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. @@ -23,6 +23,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define RECLISTS_H #include "config.h" +#include "record.h" struct reclist { diff --git a/src/record.h b/src/record.h new file mode 100644 index 0000000..1494285 --- /dev/null +++ b/src/record.h @@ -0,0 +1,70 @@ +/* $Id: record.h,v 1.1 2007-04-20 13:03:22 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. + */ + +#ifndef RECORD_H +#define RECORD_H + + +struct record; +struct client; + + +union data_types { + char *text; + struct { + int min; + int max; + } number; +}; + +struct record_metadata { + union data_types data; + struct record_metadata *next; // next item of this name +}; + +struct record { + struct client *client; + struct record_metadata **metadata; // Array mirrors list of metadata fields in config + union data_types **sortkeys; // Array mirrors list of sortkey fields in config + struct record *next; // Next in cluster of merged records +}; + +struct record_cluster +{ + struct record_metadata **metadata; // Array mirrors list of metadata fields in config + union data_types **sortkeys; + char *merge_key; + int relevance; + int *term_frequency_vec; + int recid; // Set-specific ID for this record + struct record *records; +}; + + +#endif // RECORD_H + +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ -- 1.7.10.4