8 #include <yaz/comstack.h>
9 #include <yaz/pquery.h>
11 #include <yaz/yaz-ccl.h>
12 #include "termlists.h"
13 #include "relevance.h"
17 struct client *client;
23 int *term_frequency_vec;
24 struct record *next_cluster;
29 // Represents a host (irrespective of databases)
33 struct connection *connections; // All connections to this
37 // Represents a (virtual) database on a host
43 struct database *next;
48 // Represents a physical, reusable connection to a remote Z39.50 host
53 struct client *client;
61 struct connection *next;
64 // Represents client state for a connection to one search target
66 struct database *database;
67 struct connection *connection;
68 struct session *session;
72 int requestid; // ID of current outstanding request
90 #define SESSION_WATCH_RECORDS 0
91 #define SESSION_WATCH_MAX 0
93 typedef void (*session_watchfun)(void *data);
97 struct client *clients;
100 NMEM nmem; // Nmem for each operation (i.e. search)
101 WRBUF wrbuf; // Wrbuf for scratch(i.e. search)
102 struct termlist *termlist;
103 struct relevance *relevance;
104 struct reclist *reclist;
107 session_watchfun fun;
108 } watchlist[SESSION_WATCH_MAX + 1];
115 int num_no_connection;
117 int num_initializing;
127 struct hitsbytarget {
137 int timeout; /* operations timeout, in seconds */
138 char implementationId[128];
139 char implementationName[128];
140 char implementationVersion[128];
141 int target_timeout; // seconds
145 CCL_bibset ccl_filter;
151 struct hitsbytarget *hitsbytarget(struct session *s, int *count);
152 int select_targets(struct session *se);
153 struct session *new_session();
154 void destroy_session(struct session *s);
155 int load_targets(struct session *s, const char *fn);
156 void statistics(struct session *s, struct statistics *stat);
157 char *search(struct session *s, char *query);
158 struct record **show(struct session *s, int start, int *num, int *total, int *sumhits, NMEM nmem_show);
159 struct termlist_score **termlist(struct session *s, int *num);
160 void session_set_watch(struct session *s, int what, session_watchfun fun, void *data);
167 * indent-tabs-mode: nil
169 * vim: shiftwidth=4 tabstop=8 expandtab