1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2010 Index Data.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of Index Data nor the names of its contributors
13 * may be used to endorse or promote products derived from this
14 * software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 * \brief Internal header for ZOOM implementation
31 #include <yaz/proto.h>
32 #include <yaz/oid_db.h>
33 #include <yaz/comstack.h>
34 #include <yaz/wrbuf.h>
36 #include <yaz/sortspec.h>
39 typedef struct ZOOM_Event_p *ZOOM_Event;
43 Z_SortKeySpecList *sort_spec;
57 typedef struct ZOOM_task_p *ZOOM_task;
60 #define STATE_CONNECTING 1
61 #define STATE_ESTABLISHED 2
63 struct ZOOM_connection_p {
94 int support_named_resultsets;
97 int maximum_record_size;
98 int preferred_message_size;
101 ZOOM_options options;
102 ZOOM_resultset resultsets;
103 ZOOM_Event m_queue_front;
104 ZOOM_Event m_queue_back;
105 zoom_sru_mode sru_mode;
108 struct ZOOM_options_entry {
111 int len; /* of `value', which may contain NULs */
112 struct ZOOM_options_entry *next;
115 struct ZOOM_options_p {
117 void *callback_handle;
118 ZOOM_options_callback callback_func;
119 struct ZOOM_options_entry *entries;
120 ZOOM_options parent1;
121 ZOOM_options parent2;
125 typedef struct ZOOM_record_cache_p *ZOOM_record_cache;
127 #define RECORD_HASH_SIZE 131
129 struct ZOOM_resultset_p {
130 Z_SortKeySpecList *r_sort_spec;
139 ZOOM_record_cache record_hash[RECORD_HASH_SIZE];
140 ZOOM_options options;
141 ZOOM_connection connection;
143 char **databaseNames;
144 int num_databaseNames;
147 struct ZOOM_record_p {
150 Z_NamePlusRecord *npr;
158 const char *diag_uri;
159 const char *diag_message;
160 const char *diag_details;
161 const char *diag_set;
164 struct ZOOM_record_cache_p {
165 struct ZOOM_record_p rec;
166 char *elementSetName;
170 ZOOM_record_cache next;
173 struct ZOOM_scanset_p {
176 ZOOM_options options;
177 ZOOM_connection connection;
179 Z_ScanResponse *scan_response;
180 Z_SRW_scanResponse *srw_scan_response;
182 char **databaseNames;
183 int num_databaseNames;
186 struct ZOOM_package_p {
189 ZOOM_options options;
190 ZOOM_connection connection;
199 #define ZOOM_TASK_SEARCH 1
203 ZOOM_resultset resultset;
205 char *elementSetName;
206 int recv_search_fired;
208 #define ZOOM_TASK_RETRIEVE 2
211 ZOOM_resultset resultset;
214 char *elementSetName;
216 #define ZOOM_TASK_CONNECT 3
217 #define ZOOM_TASK_SCAN 4
221 #define ZOOM_TASK_PACKAGE 5
222 ZOOM_package package;
223 #define ZOOM_TASK_SORT 6
225 ZOOM_resultset resultset;
232 struct ZOOM_Event_p {
238 void ZOOM_options_addref (ZOOM_options opt);
243 * c-file-style: "Stroustrup"
244 * indent-tabs-mode: nil
246 * vim: shiftwidth=4 tabstop=8 expandtab