2 * Copyright (c) 1995-1998, Index Data.
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation, in whole or in part, for any purpose, is hereby granted,
8 * 1. This copyright and permission notice appear in all copies of the
9 * software and its documentation. Notices of copyright or attribution
10 * which appear at the beginning of any file must remain unchanged.
12 * 2. The names of Index Data or the individual authors may not be used to
13 * endorse or promote products derived from this software without specific
14 * prior written permission.
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19 * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20 * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
21 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
22 * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
31 #include <yaz/yconfig.h>
37 typedef struct Z_TooMany
40 #define Z_TooMany_argumentWords 1
41 #define Z_TooMany_truncatedWords 2
42 #define Z_TooMany_booleanOperators 3
43 #define Z_TooMany_incompleteSubfields 4
44 #define Z_TooMany_characters 5
45 #define Z_TooMany_recordsRetrieved 6
46 #define Z_TooMany_databasesSpecified 7
47 #define Z_TooMany_resultSetsCreated 8
48 #define Z_TooMany_indexTermsProcessed 9
49 int *max; /* OPTIONAL */
52 typedef struct Z_BadSpec
54 Z_Specification *spec;
55 char *db; /* OPTIONAL */
57 Z_Specification **goodOnes; /* OPTIONAL */
60 typedef struct Z_DbUnavailWhy
62 int *reasonCode; /* OPTIONAL */
63 #define Z_DbUnavail_doesNotExist 0
64 #define Z_DbUnavail_existsButUnavail 1
65 #define Z_DbUnavail_locked 2
66 #define Z_DbUnavail_accessDenied 3
67 char *message; /* OPTIONAL */
70 typedef struct Z_DbUnavail
73 Z_DbUnavailWhy *why; /* OPTIONAL */
76 typedef struct Z_Attribute
79 int *type; /* OPTIONAL */
80 int *value; /* OPTIONAL */
81 Z_Term *term; /* OPTIONAL */
84 typedef struct Z_AttCombo
86 Z_AttributeList *unsupportedCombination;
88 Z_AttributeList **alternatives; /* OPTIONAL */
91 typedef struct Z_DiagTerm
93 int *problem; /* OPTIONAL */
94 #define Z_DiagtermProb_codedValue 1
95 #define Z_DiagtermProb_unparsable 2
96 #define Z_DiagtermProb_tooShort 3
97 #define Z_DiagtermProb_type 4
101 typedef struct Z_Proximity
104 #define Z_Proximity_resultSets 0
105 #define Z_Proximity_badSet 1
106 #define Z_Proximity_relation 2
107 #define Z_Proximity_unit 3
108 #define Z_Proximity_distance 4
109 #define Z_Proximity_attributes 5
110 #define Z_Proximity_ordered 6
111 #define Z_Proximity_exclusion 7
114 Odr_null *resultSets;
119 Z_AttributeList *attributes;
125 typedef struct Z_AttrListList
128 Z_AttributeList *lists;
131 typedef struct Z_Scan
134 #define Z_ScanD_nonZeroStepSize 0
135 #define Z_ScanD_specifiedStepSize 1
136 #define Z_ScanD_termList1 2
137 #define Z_ScanD_termList2 3
138 #define Z_ScanD_posInResponse 4
139 #define Z_ScanD_resources 5
140 #define Z_ScanD_endOfList 6
143 Odr_null *nonZeroStepSize;
144 Odr_null *specifiedStepSize;
146 Z_AttrListList *termList2;
148 #define Z_ScanPosInRsp_mustBeOne 1
149 #define Z_ScanPosInRsp_mustBePositive 2
150 #define Z_ScanPosInRsp_mustBeNonNegative 3
151 #define Z_ScanPosInRsp_other 4
157 typedef struct Z_Sort
160 #define Z_SortD_sequence 0
161 #define Z_SortD_noRsName 1
162 #define Z_SortD_tooMany 2
163 #define Z_SortD_incompatible 3
164 #define Z_SortD_generic 4
165 #define Z_SortD_dbSpecific 5
166 #define Z_SortD_sortElement 6
167 #define Z_SortD_key 7
168 #define Z_SortD_action 8
169 #define Z_SortD_illegal 9
170 #define Z_SortD_inputTooLarge 10
171 #define Z_SortD_aggregateTooLarge 11
177 Odr_null *incompatible;
179 Odr_null *dbSpecific;
181 #define Z_SortKey_tooMany 1
182 #define Z_SortKey_duplicate 2
185 #define Z_SortIllegal_relation 1
186 #define Z_SortIllegal_case 2
187 #define Z_SortIllegal_action 3
188 #define Z_SortIllegal_sort 4
189 Z_StringList *inputTooLarge;
190 Odr_null *aggregateTooLarge;
194 typedef struct Z_Segmentation
197 #define Z_SegmentationD_segments 0
204 typedef struct Z_ExtServices
207 #define Z_ExtServicesD_req 0
208 #define Z_ExtServicesD_permission 1
209 #define Z_ExtServicesD_immediate 2
213 #define Z_ExtSrvReq_nameInUse 1
214 #define Z_ExtSrvReq_noSuchname 2
215 #define Z_ExtSrvReq_quota 3
216 #define Z_ExtSrvReq_type 4
218 #define Z_ExtSrvPerm_id 1
219 #define Z_ExtSrvPerm_modifyDelete 2
221 #define Z_ExtSrvImm_failed 1
222 #define Z_ExtSrvImm_service 2
223 #define Z_ExtSrvImm_parameters 3
227 typedef struct Z_OidList
233 typedef struct Z_AccessCtrl
236 #define Z_AccessCtrlD_noUser 0
237 #define Z_AccessCtrlD_refused 1
238 #define Z_AccessCtrlD_simple 2
239 #define Z_AccessCtrlD_oid 3
240 #define Z_AccessCtrlD_alternative 4
241 #define Z_AccessCtrlD_pwdInv 5
242 #define Z_AccessCtrlD_pwdExp 6
249 Z_OidList *alternative;
255 typedef struct Z_RecordSyntax
257 Odr_oid *unsupportedSyntax;
258 int num_suggestedAlternatives; /* OPTIONAL */
259 Odr_oid **suggestedAlternatives; /* OPTIONAL */
262 typedef struct Z_DiagFormat
265 #define Z_DiagFormat_tooMany 0
266 #define Z_DiagFormat_badSpec 1
267 #define Z_DiagFormat_dbUnavail 2
268 #define Z_DiagFormat_unSupOp 3
269 #define Z_DiagFormat_attribute 4
270 #define Z_DiagFormat_attCombo 5
271 #define Z_DiagFormat_term 6
272 #define Z_DiagFormat_proximity 7
273 #define Z_DiagFormat_scan 8
274 #define Z_DiagFormat_sort 9
275 #define Z_DiagFormat_segmentation 10
276 #define Z_DiagFormat_extServices 11
277 #define Z_DiagFormat_accessCtrl 12
278 #define Z_DiagFormat_recordSyntax 13
283 Z_DbUnavail *dbUnavail;
285 #define Z_UnSupOp_and 0
286 #define Z_UnSupOp_or 1
287 #define Z_UnSupOp_and_not 2
288 #define Z_UnSupOp_prox 3
289 Z_Attribute *attribute;
290 Z_AttributeList *attCombo;
292 Z_Proximity *proximity;
295 Z_Segmentation *segmentation;
296 Z_ExtServices *extServices;
297 Z_AccessCtrl *accessCtrl;
298 Z_RecordSyntax *recordSyntax;
302 typedef struct Z_Diagnostic
305 #define Z_Diagnostic_defaultDiagRec 0
306 #define Z_Diagnostic_explicitDiagnostic 1
309 Z_DefaultDiagFormat *defaultDiagRec;
310 Z_DiagFormat *explicitDiagnostic;
314 typedef struct Z_DiagnosticUnit
316 Z_Diagnostic *diagnostic; /* OPTIONAL */
317 char *message; /* OPTIONAL */
320 typedef struct Z_DiagnosticFormat
323 Z_DiagnosticUnit **diagnostics;
324 } Z_DiagnosticFormat;
326 YAZ_EXPORT int z_DiagnosticFormat(ODR o, Z_DiagnosticFormat **p, int opt,