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"
21 struct client *client;
27 int *term_frequency_vec;
28 struct record *next_cluster;
33 // Represents a host (irrespective of databases)
37 struct connection *connections; // All connections to this
41 // Represents a (virtual) database on a host
47 struct database *next;
52 // Represents a physical, reusable connection to a remote Z39.50 host
57 struct client *client;
65 struct connection *next;
68 // Represents client state for a connection to one search target
70 struct database *database;
71 struct connection *connection;
72 struct session *session;
76 int requestid; // ID of current outstanding request
94 #define SESSION_WATCH_RECORDS 0
95 #define SESSION_WATCH_MAX 0
97 typedef void (*session_watchfun)(void *data);
101 struct client *clients;
104 NMEM nmem; // Nmem for each operation (i.e. search)
105 WRBUF wrbuf; // Wrbuf for scratch(i.e. search)
106 struct termlist *termlist;
107 struct relevance *relevance;
108 struct reclist *reclist;
111 session_watchfun fun;
112 } watchlist[SESSION_WATCH_MAX + 1];
119 int num_no_connection;
121 int num_initializing;
131 struct hitsbytarget {
141 int timeout; /* operations timeout, in seconds */
142 char implementationId[128];
143 char implementationName[128];
144 char implementationVersion[128];
145 int target_timeout; // seconds
149 CCL_bibset ccl_filter;
153 xsltStylesheetPtr xsl;
156 struct hitsbytarget *hitsbytarget(struct session *s, int *count);
157 int select_targets(struct session *se);
158 struct session *new_session();
159 void destroy_session(struct session *s);
160 int load_targets(struct session *s, const char *fn);
161 void statistics(struct session *s, struct statistics *stat);
162 char *search(struct session *s, char *query);
163 struct record **show(struct session *s, int start, int *num, int *total, int *sumhits, NMEM nmem_show);
164 struct termlist_score **termlist(struct session *s, int *num);
165 void session_set_watch(struct session *s, int what, session_watchfun fun, void *data);
172 * indent-tabs-mode: nil
174 * vim: shiftwidth=4 tabstop=8 expandtab