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
37 struct client *client;
41 struct record_metadata *md;
43 int *term_frequency_vec;
44 struct record *next_cluster;
49 // Represents a host (irrespective of databases)
53 struct connection *connections; // All connections to this
57 // Represents a (virtual) database on a host
63 struct conf_queryprofile *qprofile;
64 struct conf_retrievalprofile *rprofile;
65 struct database *next;
69 // Represents a physical, reusable connection to a remote Z39.50 host
74 struct client *client;
82 struct connection *next;
85 // Represents client state for a connection to one search target
87 struct database *database;
88 struct connection *connection;
89 struct session *session;
93 int requestid; // ID of current outstanding request
111 #define SESSION_WATCH_RECORDS 0
112 #define SESSION_WATCH_MAX 0
114 #define SESSION_MAX_TERMLISTS 10
116 typedef void (*session_watchfun)(void *data);
118 struct named_termlist
121 struct termlist *termlist;
126 struct client *clients;
129 NMEM nmem; // Nmem for each operation (i.e. search)
130 WRBUF wrbuf; // Wrbuf for scratch(i.e. search)
132 struct named_termlist termlists[SESSION_MAX_TERMLISTS];
133 struct relevance *relevance;
134 struct reclist *reclist;
137 session_watchfun fun;
138 } watchlist[SESSION_WATCH_MAX + 1];
139 int expected_maxrecs;
146 int num_no_connection;
148 int num_initializing;
158 struct hitsbytarget {
169 int timeout; /* operations timeout, in seconds */
170 char implementationId[128];
171 char implementationName[128];
172 char implementationVersion[128];
173 int target_timeout; // seconds
177 CCL_bibset ccl_filter;
183 struct hitsbytarget *hitsbytarget(struct session *s, int *count);
184 int select_targets(struct session *se);
185 struct session *new_session();
186 void destroy_session(struct session *s);
187 int load_targets(struct session *s, const char *fn);
188 void statistics(struct session *s, struct statistics *stat);
189 char *search(struct session *s, char *query);
190 struct record **show(struct session *s, int start, int *num, int *total,
191 int *sumhits, NMEM nmem_show);
192 struct termlist_score **termlist(struct session *s, const char *name, int *num);
193 void session_set_watch(struct session *s, int what, session_watchfun fun, void *data);
194 int session_active_clients(struct session *s);
201 * indent-tabs-mode: nil
203 * vim: shiftwidth=4 tabstop=8 expandtab