Remove the oid_name_to_dotstring() function, which is now in oid.c
[yaz-moved-to-github.git] / zutil / zoom-p.h
1 /*
2  * Private C header for ZOOM C.
3  * $Id: zoom-p.h,v 1.9 2003-06-02 12:53:28 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     char *query_string;
23 };
24
25 #define STATE_IDLE 0
26 #define STATE_CONNECTING 1
27 #define STATE_ESTABLISHED 2
28
29 #define ZOOM_SELECT_READ 1
30 #define ZOOM_SELECT_WRITE 2
31 #define ZOOM_SELECT_EXCEPT 4
32
33 struct ZOOM_connection_p {
34     enum oid_proto proto;
35     COMSTACK cs;
36     char *host_port;
37     char *path;
38     int error;
39     char *addinfo;
40     const char *diagset;
41     int state;
42     int mask;
43     int reconnect_ok;
44     ODR odr_in;
45     ODR odr_out;
46     char *buf_in;
47     int len_in;
48     char *buf_out;
49     int len_out;
50     char *proxy;
51     char *charset;
52     char *lang;
53     char *cookie_out;
54     char *cookie_in;
55     char *client_IP;
56     int async;
57     int support_named_resultsets;
58     int last_event;
59     ZOOM_task tasks;
60     ZOOM_options options;
61     ZOOM_resultset resultsets;
62     ZOOM_Event m_queue_front;
63     ZOOM_Event m_queue_back;
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_SortKeySpecList *r_sort_spec;
85     ZOOM_query query;
86     int refcount;
87     int size;
88     int start;
89     int count;
90     int step;
91     int piggyback;
92     char *setname;
93     char *schema;
94     ODR odr;
95     ZOOM_record_cache record_cache;
96     ZOOM_options options;
97     ZOOM_connection connection;
98     ZOOM_resultset next;
99 };
100
101 struct ZOOM_record_p {
102     ODR odr;
103     WRBUF wrbuf_marc;
104     WRBUF wrbuf_iconv;
105     Z_NamePlusRecord *npr;
106 };
107
108 struct ZOOM_record_cache_p {
109     struct ZOOM_record_p rec;
110     char *elementSetName;
111     char *syntax;
112     char *schema;
113     int pos;
114     ZOOM_record_cache next;
115 };
116
117 struct ZOOM_scanset_p {
118     int refcount;
119     ODR odr;
120     ZOOM_options options;
121     ZOOM_connection connection;
122     Z_AttributesPlusTerm *termListAndStartPoint;
123     Z_AttributeSetId *attributeSet;
124     Z_ScanResponse *scan_response;
125 };
126
127 struct ZOOM_package_p {
128     int refcount;
129     ODR odr_out;
130     ZOOM_options options;
131     ZOOM_connection connection;
132     char *buf_out;
133     int len_out;
134 };
135
136 struct ZOOM_task_p {
137     int running;
138     int which;
139     union {
140 #define ZOOM_TASK_SEARCH 1
141         struct {
142             ZOOM_resultset resultset;
143         } search;
144 #define ZOOM_TASK_RETRIEVE 2
145         struct {
146             int start;
147             ZOOM_resultset resultset;
148             int count;
149         } retrieve;
150 #define ZOOM_TASK_CONNECT 3
151 #define ZOOM_TASK_SCAN 4
152         struct {
153             ZOOM_scanset scan;
154         } scan;
155 #define ZOOM_TASK_PACKAGE 5
156         ZOOM_package package;
157     } u;
158     ZOOM_task next;
159 };
160
161 struct ZOOM_Event_p {
162     int kind;
163     ZOOM_Event next;
164     ZOOM_Event prev;
165 };
166
167 void ZOOM_options_addref (ZOOM_options opt);