Perform getaddrinfo in separate thread for a given struct host.
[pazpar2-moved-to-github.git] / src / pazpar2.h
index 1f65270..ef910ab 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pazpar2.h,v 1.25 2007-04-17 21:25:26 quinn Exp $
+/* $Id: pazpar2.h,v 1.32 2007-04-21 12:00:54 adam 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 <netdb.h>
 
@@ -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)
@@ -92,16 +61,6 @@ struct database {
     struct zr_explain *explain;
     struct setting **settings;
     struct database *next;
-    CCL_bibset ccl_map;
-    yaz_marc_t yaz_marc;
-    struct database_retrievalmap *map;
-};
-
-// Normalization filter. Turns incoming record into internal representation
-// Simple sequence of stylesheets run in series.
-struct database_retrievalmap {
-    xsltStylesheet *stylesheet;
-    struct database_retrievalmap *next;
 };
 
 struct database_criterion_value {
@@ -158,6 +117,24 @@ struct client {
     struct client *next;
 };
 
+// Normalization filter. Turns incoming record into internal representation
+// Simple sequence of stylesheets run in series.
+struct database_retrievalmap {
+    xsltStylesheet *stylesheet;
+    struct database_retrievalmap *next;
+};
+
+// Represents a database as viewed from one session, possibly with settings overriden
+// for that session
+struct session_database
+{
+    struct database *database;
+    struct setting **settings;
+    yaz_marc_t yaz_marc;
+    struct database_retrievalmap *map;
+    struct session_database *next;
+};
+
 #define SESSION_WATCH_RECORDS   0
 #define SESSION_WATCH_MAX       0
 
@@ -171,21 +148,11 @@ struct named_termlist
     struct termlist *termlist;
 };
 
-// Represents a database as viewed from one session, possibly with settings overriden
-// for that session (to support authorization/authentication)
-struct session_database
-{
-    struct database *database;
-    struct setting **settings;
-    struct session_database *next;
-};
-
 // End-user session
 struct session {
     struct session_database *databases;  // All databases, settings overriden
     struct client *clients;              // Clients connected for current search
     int requestid; 
-    char query[1024];
     NMEM session_nmem;  // Nmem for session-permanent storage
     NMEM nmem;          // Nmem for each operation (i.e. search, result set, etc)
     WRBUF wrbuf;        // Wrbuf for scratch(i.e. search)
@@ -267,7 +234,10 @@ void start_proxy(void);
 void start_zproxy(void);
 
 extern struct parameters global_parameters;
-extern IOCHAN channel_list;
+void pazpar2_add_channel(IOCHAN c);
+void pazpar2_event_loop(void);
+
+int host_getaddrinfo(struct host *host);
 
 #endif