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;
37 struct record_metadata **metadata; // Array mirrors list of metadata fields in config
39 int *term_frequency_vec;
45 struct record_metadata **metadata; // Array mirrors list of metadata fields in config
48 int *term_frequency_vec;
49 struct record *records;
54 // Represents a host (irrespective of databases)
58 struct connection *connections; // All connections to this
62 // Represents a (virtual) database on a host
68 struct conf_queryprofile *qprofile;
69 struct conf_retrievalprofile *rprofile;
70 struct database *next;
74 // Represents a physical, reusable connection to a remote Z39.50 host
79 struct client *client;
87 struct connection *next;
90 // Represents client state for a connection to one search target
92 struct database *database;
93 struct connection *connection;
94 struct session *session;
98 int requestid; // ID of current outstanding request
116 #define SESSION_WATCH_RECORDS 0
117 #define SESSION_WATCH_MAX 0
119 #define SESSION_MAX_TERMLISTS 10
121 typedef void (*session_watchfun)(void *data);
123 struct named_termlist
126 struct termlist *termlist;
131 struct client *clients;
134 NMEM nmem; // Nmem for each operation (i.e. search)
135 WRBUF wrbuf; // Wrbuf for scratch(i.e. search)
137 struct named_termlist termlists[SESSION_MAX_TERMLISTS];
138 struct relevance *relevance;
139 struct reclist *reclist;
142 session_watchfun fun;
143 } watchlist[SESSION_WATCH_MAX + 1];
144 int expected_maxrecs;
151 int num_no_connection;
153 int num_initializing;
163 struct hitsbytarget {
173 struct conf_server *server;
175 int timeout; /* operations timeout, in seconds */
176 char implementationId[128];
177 char implementationName[128];
178 char implementationVersion[128];
179 int target_timeout; // seconds
183 CCL_bibset ccl_filter;
189 struct hitsbytarget *hitsbytarget(struct session *s, int *count);
190 int select_targets(struct session *se);
191 struct session *new_session();
192 void destroy_session(struct session *s);
193 int load_targets(struct session *s, const char *fn);
194 void statistics(struct session *s, struct statistics *stat);
195 char *search(struct session *s, char *query);
196 struct record_cluster **show(struct session *s, int start, int *num, int *total,
197 int *sumhits, NMEM nmem_show);
198 struct termlist_score **termlist(struct session *s, const char *name, int *num);
199 void session_set_watch(struct session *s, int what, session_watchfun fun, void *data);
200 int session_active_clients(struct session *s);
207 * indent-tabs-mode: nil
209 * vim: shiftwidth=4 tabstop=8 expandtab