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