8 #include <libxslt/xsltutils.h>
9 #include <libxslt/transform.h>
11 #include <yaz/comstack.h>
12 #include <yaz/pquery.h>
14 #include <yaz/yaz-ccl.h>
16 #include "termlists.h"
17 #include "relevance.h"
32 struct record_metadata {
33 union data_types data;
34 struct record_metadata *next; // next item of this name
38 struct client *client;
39 struct record_metadata **metadata; // Array mirrors list of metadata fields in config
40 union data_types **sortkeys; // Array mirrors list of sortkey fields in config
41 struct record *next; // Next in cluster of merged records
46 struct record_metadata **metadata; // Array mirrors list of metadata fields in config
47 union data_types **sortkeys;
50 int *term_frequency_vec;
51 int recid; // Set-specific ID for this record
52 struct record *records;
57 // Represents a host (irrespective of databases)
61 struct connection *connections; // All connections to this
65 // Represents a (virtual) database on a host
72 struct zr_explain *explain;
73 struct setting **settings;
74 struct database *next;
77 struct database_retrievalmap *map;
80 // Normalization filter chain. Turns incoming record into internal representation
81 struct database_retrievalmap {
82 xsltStylesheet *stylesheet;
83 struct database_retrievalmap *next;
86 struct database_criterion_value {
88 struct database_criterion_value *next;
91 struct database_criterion {
93 struct database_criterion_value *values;
94 struct database_criterion *next;
97 // Represents a physical, reusable connection to a remote Z39.50 host
102 struct client *client;
110 struct connection *next;
113 // Represents client state for a connection to one search target
115 struct database *database;
116 struct connection *connection;
117 struct session *session;
121 int requestid; // ID of current outstanding request
139 #define SESSION_WATCH_RECORDS 0
140 #define SESSION_WATCH_MAX 0
142 #define SESSION_MAX_TERMLISTS 10
144 typedef void (*session_watchfun)(void *data);
146 struct named_termlist
149 struct termlist *termlist;
154 struct client *clients;
157 NMEM nmem; // Nmem for each operation (i.e. search)
158 WRBUF wrbuf; // Wrbuf for scratch(i.e. search)
160 struct named_termlist termlists[SESSION_MAX_TERMLISTS];
161 struct relevance *relevance;
162 struct reclist *reclist;
165 session_watchfun fun;
166 } watchlist[SESSION_WATCH_MAX + 1];
167 int expected_maxrecs;
175 int num_no_connection;
177 int num_initializing;
187 struct hitsbytarget {
198 char proxy_override[128];
199 char listener_override[128];
200 char zproxy_override[128];
201 char settings_path_override[128];
202 struct conf_server *server;
204 int timeout; /* operations timeout, in seconds */
205 char implementationId[128];
206 char implementationName[128];
207 char implementationVersion[128];
208 int target_timeout; // seconds
216 struct hitsbytarget *hitsbytarget(struct session *s, int *count);
217 int select_targets(struct session *se, struct database_criterion *crit);
218 struct session *new_session();
219 void destroy_session(struct session *s);
220 int load_targets(struct session *s, const char *fn);
221 void statistics(struct session *s, struct statistics *stat);
222 char *search(struct session *s, char *query, char *filter);
223 struct record_cluster **show(struct session *s, struct reclist_sortparms *sp, int start,
224 int *num, int *total, int *sumhits, NMEM nmem_show);
225 struct record_cluster *show_single(struct session *s, int id);
226 struct termlist_score **termlist(struct session *s, const char *name, int *num);
227 void session_set_watch(struct session *s, int what, session_watchfun fun, void *data);
228 int session_active_clients(struct session *s);
235 * indent-tabs-mode: nil
237 * vim: shiftwidth=4 tabstop=8 expandtab