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"
23 struct record_metadata {
31 struct record_metadata *next; // next item of this name
35 struct client *client;
36 struct record_metadata **metadata; // Array mirrors list of metadata fields in config
37 struct record *next; // Next in cluster of merged records
42 struct record_metadata **metadata; // Array mirrors list of metadata fields in config
45 int *term_frequency_vec;
46 int recid; // Set-specific ID for this record
47 struct record *records;
52 // Represents a host (irrespective of databases)
56 struct connection *connections; // All connections to this
60 // Represents a (virtual) database on a host
66 struct conf_queryprofile *qprofile;
67 struct conf_retrievalprofile *rprofile;
68 struct database *next;
72 // Represents a physical, reusable connection to a remote Z39.50 host
77 struct client *client;
85 struct connection *next;
88 // Represents client state for a connection to one search target
90 struct database *database;
91 struct connection *connection;
92 struct session *session;
96 int requestid; // ID of current outstanding request
114 #define SESSION_WATCH_RECORDS 0
115 #define SESSION_WATCH_MAX 0
117 #define SESSION_MAX_TERMLISTS 10
119 typedef void (*session_watchfun)(void *data);
121 struct named_termlist
124 struct termlist *termlist;
129 struct client *clients;
132 NMEM nmem; // Nmem for each operation (i.e. search)
133 WRBUF wrbuf; // Wrbuf for scratch(i.e. search)
135 struct named_termlist termlists[SESSION_MAX_TERMLISTS];
136 struct relevance *relevance;
137 struct reclist *reclist;
140 session_watchfun fun;
141 } watchlist[SESSION_WATCH_MAX + 1];
142 int expected_maxrecs;
150 int num_no_connection;
152 int num_initializing;
162 struct hitsbytarget {
172 char proxy_override[128];
173 char listener_override[128];
174 struct conf_server *server;
176 int timeout; /* operations timeout, in seconds */
177 char implementationId[128];
178 char implementationName[128];
179 char implementationVersion[128];
180 int target_timeout; // seconds
184 CCL_bibset ccl_filter;
190 struct hitsbytarget *hitsbytarget(struct session *s, int *count);
191 int select_targets(struct session *se);
192 struct session *new_session();
193 void destroy_session(struct session *s);
194 int load_targets(struct session *s, const char *fn);
195 void statistics(struct session *s, struct statistics *stat);
196 char *search(struct session *s, char *query);
197 struct record_cluster **show(struct session *s, int start, int *num, int *total,
198 int *sumhits, NMEM nmem_show);
199 struct record_cluster *show_single(struct session *s, int id);
200 struct termlist_score **termlist(struct session *s, const char *name, int *num);
201 void session_set_watch(struct session *s, int what, session_watchfun fun, void *data);
202 int session_active_clients(struct session *s);
209 * indent-tabs-mode: nil
211 * vim: shiftwidth=4 tabstop=8 expandtab