8 #include <yaz/comstack.h>
9 #include <yaz/pquery.h>
11 #include <yaz/yaz-ccl.h>
12 #include "termlists.h"
13 #include "relevance.h"
16 #define MAX_DATABASES 512
19 struct client *client;
25 int *term_frequency_vec;
26 struct record *next_cluster;
31 // Represents a host (irrespective of databases)
35 struct connection *connections; // All connections to this
39 // Represents a (virtual) database on a host
43 char databases[MAX_DATABASES][128];
45 struct database *next;
50 // Represents a physical, reusable connection to a remote Z39.50 host
55 struct client *client;
63 struct connection *next;
66 // Represents client state for a connection to one search target
68 struct database *database;
69 struct connection *connection;
70 struct session *session;
74 int requestid; // ID of current outstanding request
92 #define SESSION_WATCH_RECORDS 0
93 #define SESSION_WATCH_MAX 0
95 typedef void (*session_watchfun)(void *data);
99 struct client *clients;
102 NMEM nmem; // Nmem for each operation (i.e. search)
103 WRBUF wrbuf; // Wrbuf for scratch(i.e. search)
104 struct termlist *termlist;
105 struct relevance *relevance;
106 struct reclist *reclist;
109 session_watchfun fun;
110 } watchlist[SESSION_WATCH_MAX + 1];
117 int num_no_connection;
119 int num_initializing;
129 struct hitsbytarget {
139 int timeout; /* operations timeout, in seconds */
140 char implementationId[128];
141 char implementationName[128];
142 char implementationVersion[128];
143 int target_timeout; // seconds
147 CCL_bibset ccl_filter;
153 struct hitsbytarget *hitsbytarget(struct session *s, int *count);
154 int select_targets(struct session *se);
155 struct session *new_session();
156 void destroy_session(struct session *s);
157 int load_targets(struct session *s, const char *fn);
158 void statistics(struct session *s, struct statistics *stat);
159 char *search(struct session *s, char *query);
160 struct record **show(struct session *s, int start, int *num, int *total, int *sumhits);
161 struct termlist_score **termlist(struct session *s, int *num);
162 void session_set_watch(struct session *s, int what, session_watchfun fun, void *data);
169 * indent-tabs-mode: nil
171 * vim: shiftwidth=4 tabstop=8 expandtab