More type casts. Modify CQL tree - bool is C++ reserved name.
[yaz-moved-to-github.git] / zutil / zoom-p.h
1 /*
2  * Private C header for ZOOM C.
3  * $Id: zoom-p.h,v 1.4 2003-02-14 18:49:24 adam Exp $
4  */
5
6 #if HAVE_XSLT
7 #include <yaz/srw.h>
8 #endif
9
10 #include <yaz/proto.h>
11 #include <yaz/comstack.h>
12 #include <yaz/wrbuf.h>
13 #include <yaz/zoom.h>
14 #include <yaz/sortspec.h>
15 typedef struct ZOOM_Event_p *ZOOM_Event;
16
17 struct ZOOM_query_p {
18     Z_Query *z_query;
19     Z_SortKeySpecList *sort_spec;
20     int refcount;
21     ODR odr;
22 };
23
24 #define STATE_IDLE 0
25 #define STATE_CONNECTING 1
26 #define STATE_ESTABLISHED 2
27
28 #define ZOOM_SELECT_READ 1
29 #define ZOOM_SELECT_WRITE 2
30 #define ZOOM_SELECT_EXCEPT 4
31
32 struct ZOOM_connection_p {
33     enum oid_proto proto;
34     COMSTACK cs;
35     char *host_port;
36     char *path;
37     int error;
38     char *addinfo;
39     const char *diagset;
40     int state;
41     int mask;
42     int reconnect_ok;
43     ODR odr_in;
44     ODR odr_out;
45     char *buf_in;
46     int len_in;
47     char *buf_out;
48     int len_out;
49     char *proxy;
50     char *charset;
51     char *lang;
52     char *cookie_out;
53     char *cookie_in;
54     char *client_IP;
55     int async;
56     int support_named_resultsets;
57     int last_event;
58     ZOOM_task tasks;
59     ZOOM_options options;
60     ZOOM_resultset resultsets;
61     ZOOM_Event m_queue_front;
62     ZOOM_Event m_queue_back;
63 };
64
65
66 struct ZOOM_options_entry {
67     char *name;
68     char *value;
69     struct ZOOM_options_entry *next;
70 };
71
72 struct ZOOM_options_p {
73     int refcount;
74     void *callback_handle;
75     ZOOM_options_callback callback_func;
76     struct ZOOM_options_entry *entries;
77     ZOOM_options parent1;
78     ZOOM_options parent2;
79 };
80
81 typedef struct ZOOM_record_cache_p *ZOOM_record_cache;
82
83 struct ZOOM_resultset_p {
84     Z_Query *z_query;
85     Z_SortKeySpecList *r_sort_spec;
86     ZOOM_query search;
87     int refcount;
88     int size;
89     int start;
90     int count;
91     int piggyback;
92     char *setname;
93     ODR odr;
94     ZOOM_record_cache record_cache;
95     ZOOM_options options;
96     ZOOM_connection connection;
97     ZOOM_resultset next;
98 };
99
100 struct ZOOM_record_p {
101     ODR odr;
102     WRBUF wrbuf_marc;
103     Z_NamePlusRecord *npr;
104 };
105
106 struct ZOOM_record_cache_p {
107     struct ZOOM_record_p rec;
108     char *elementSetName;
109     char *syntax;
110     int pos;
111     ZOOM_record_cache next;
112 };
113
114 struct ZOOM_scanset_p {
115     int refcount;
116     ODR odr;
117     ZOOM_options options;
118     ZOOM_connection connection;
119     Z_AttributesPlusTerm *termListAndStartPoint;
120     Z_AttributeSetId *attributeSet;
121     Z_ScanResponse *scan_response;
122 };
123
124 struct ZOOM_package_p {
125     int refcount;
126     ODR odr_out;
127     ZOOM_options options;
128     ZOOM_connection connection;
129     char *buf_out;
130     int len_out;
131 };
132
133 struct ZOOM_task_p {
134     int running;
135     int which;
136     union {
137 #define ZOOM_TASK_SEARCH 1
138         struct {
139             ZOOM_resultset resultset;
140         } search;
141 #define ZOOM_TASK_RETRIEVE 2
142         struct {
143             int start;
144             ZOOM_resultset resultset;
145             int count;
146         } retrieve;
147 #define ZOOM_TASK_CONNECT 3
148 #define ZOOM_TASK_SCAN 4
149         struct {
150             ZOOM_scanset scan;
151         } scan;
152 #define ZOOM_TASK_PACKAGE 5
153         ZOOM_package package;
154     } u;
155     ZOOM_task next;
156 };
157
158 struct ZOOM_Event_p {
159     int kind;
160     ZOOM_Event next;
161     ZOOM_Event prev;
162 };
163
164 void ZOOM_options_addref (ZOOM_options opt);