-/* $Id: pazpar2.h,v 1.28 2007-04-20 04:32:33 quinn Exp $
+/* $Id: pazpar2.h,v 1.33 2007-04-22 16:41:42 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
#ifndef PAZPAR2_H
#define PAZPAR2_H
-struct record;
#include <netdb.h>
#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)
struct zr_explain *explain;
struct setting **settings;
struct database *next;
- 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 {
char *ibuf;
int ibufsize;
enum {
+ Conn_Resolving,
Conn_Connecting,
Conn_Open,
Conn_Waiting,
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
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
extern struct parameters global_parameters;
void pazpar2_add_channel(IOCHAN c);
void pazpar2_event_loop(void);
+
+int host_getaddrinfo(struct host *host);
+void connect_resolver_host(struct host *host);
+
#endif
/*