Initial revision
[pazpar2-moved-to-github.git] / pazpar2.h
1 #ifndef PAZPAR2_H
2 #define PAZPAR2_H
3
4 #include <yaz/pquery.h>
5
6 struct session {
7     struct target *targets;
8     YAZ_PQF_Parser pqf_parser;
9     int requestid; 
10     char query[1024];
11     NMEM nmem;
12 };
13
14 struct record {
15     struct target *target;
16     int target_offset;
17     char *buf;
18     char *merge_key;
19     struct record *next_cluster;
20     struct record *head_cluster;
21 };
22
23 struct statistics {
24     int num_connections;
25     int num_no_connection;
26     int num_connecting;
27     int num_initializing;
28     int num_searching;
29     int num_presenting;
30     int num_idle;
31     int num_failed;
32     int num_error;
33 };
34
35 struct hitsbytarget {
36     char id[256];
37     int hits;
38     int diagnostic;
39     int records;
40     char* state;
41 };
42
43 struct hitsbytarget *hitsbytarget(struct session *s, int *count);
44 struct session *new_session();
45 int load_targets(struct session *s, const char *fn);
46 void statistics(struct session *s, struct statistics *stat);
47 void search(struct session *s, char *query);
48
49 #endif
50
51 /*
52  * Local variables:
53  * c-basic-offset: 4
54  * indent-tabs-mode: nil
55  * End:
56  * vim: shiftwidth=4 tabstop=8 expandtab
57  */