Fixed Scan bug in asn and client
[yaz-moved-to-github.git] / include / proto.h
1 /*
2  * Copyright (c) 1995-1998, Index Data.
3  *
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,
6  * provided that:
7  *
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.
11  *
12  * 2. The name 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.
15  *
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
24  * OF THIS SOFTWARE.
25  *
26  * $Log: proto.h,v $
27  * Revision 1.46  1998-10-20 13:55:44  quinn
28  * Fixed Scan bug in asn and client
29  *
30  * Revision 1.45  1998/08/19 16:10:07  adam
31  * Changed som member names of DeleteResultSetRequest/Response.
32  *
33  * Revision 1.44  1998/05/18 10:14:08  adam
34  * Minor change - removed 'dead' definitions.
35  *
36  * Revision 1.43  1998/03/31 11:07:45  adam
37  * Furhter work on UNIverse resource report.
38  * Added Extended Services handling in frontend server.
39  *
40  * Revision 1.42  1998/03/20 14:46:06  adam
41  * Added UNIverse Resource Reports.
42  *
43  * Revision 1.41  1998/02/10 15:31:52  adam
44  * Implemented date and time structure. Changed the Update Extended
45  * Service.
46  *
47  * Revision 1.40  1997/09/01 08:49:50  adam
48  * New windows NT/95 port using MSV5.0. To export DLL functions the
49  * YAZ_EXPORT modifier was added. Defined in yconfig.h.
50  *
51  * Revision 1.39  1997/05/14 06:53:44  adam
52  * C++ support.
53  *
54  * Revision 1.38  1997/04/30 08:52:09  quinn
55  * Null
56  *
57  * Revision 1.37  1996/10/09  15:54:58  quinn
58  * Added SearchInfoReport
59  *
60  * Revision 1.36  1996/10/07  15:29:20  quinn
61  * Added SOIF support
62  *
63  * Revision 1.35  1996/06/10  08:57:38  quinn
64  * Added OPAC, ResourceReport
65  *
66  * Revision 1.34  1996/06/10  08:55:36  quinn
67  * Added Summary.
68  *
69  * Revision 1.33  1996/02/23  10:00:51  quinn
70  * SCAN Work
71  *
72  * Revision 1.32  1996/02/20  12:52:39  quinn
73  * Various
74  *
75  * Revision 1.31  1996/01/22  09:46:45  quinn
76  * Added Sort PDU. Moved StringList to main protocol file.
77  *
78  * Revision 1.30  1996/01/10  15:21:32  quinn
79  * Added links to access control PDUs
80  *
81  * Revision 1.29  1996/01/02  11:46:49  quinn
82  * Changed 'operator' to 'roperator' to avoid C++ conflict.
83  * Moved to pl3
84  *
85  * Revision 1.28  1996/01/02  08:57:32  quinn
86  * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
87  *
88  * Revision 1.27  1995/10/12  10:34:46  quinn
89  * Added Espec-1.
90  *
91  * Revision 1.26  1995/09/29  17:12:08  quinn
92  * Smallish
93  *
94  * Revision 1.25  1995/09/27  15:02:49  quinn
95  * Modified function heads & prototypes.
96  *
97  * Revision 1.24  1995/08/29  11:17:43  quinn
98  * *** empty log message ***
99  *
100  * Revision 1.23  1995/08/21  09:10:36  quinn
101  * Smallish fixes to suppport new formats.
102  *
103  * Revision 1.22  1995/08/17  12:45:14  quinn
104  * Fixed minor problems with GRS-1. Added support in c&s.
105  *
106  * Revision 1.21  1995/08/15  12:00:11  quinn
107  * Updated External
108  *
109  * Revision 1.20  1995/08/10  08:54:35  quinn
110  * Added Explain.
111  *
112  * Revision 1.19  1995/06/19  12:38:28  quinn
113  * Reorganized include-files. Added small features.
114  *
115  * Revision 1.18  1995/06/16  13:16:05  quinn
116  * Fixed Defaultdiagformat.
117  *
118  * Revision 1.17  1995/06/15  15:42:05  quinn
119  * Fixed some v3 bugs
120  *
121  * Revision 1.16  1995/06/15  07:45:06  quinn
122  * Moving to v3.
123  *
124  * Revision 1.15  1995/06/14  15:26:43  quinn
125  * *** empty log message ***
126  *
127  * Revision 1.14  1995/06/07  14:42:34  quinn
128  * Fixed CLOSE
129  *
130  * Revision 1.13  1995/06/07  14:36:47  quinn
131  * Added CLOSE
132  *
133  * Revision 1.12  1995/06/05  10:53:13  quinn
134  * Smallish.
135  *
136  * Revision 1.11  1995/06/02  09:49:47  quinn
137  * Add access control
138  *
139  * Revision 1.10  1995/05/29  08:11:34  quinn
140  * Moved oid from odr/asn to util.
141  *
142  * Revision 1.9  1995/05/22  11:31:25  quinn
143  * Added PDUs
144  *
145  * Revision 1.8  1995/05/17  08:41:35  quinn
146  * Added delete to proto & other little things.
147  * Relaying auth info to backend.
148  *
149  * Revision 1.7  1995/05/16  08:50:37  quinn
150  * License, documentation, and memory fixes
151  *
152  * Revision 1.6  1995/05/15  11:55:55  quinn
153  * Work on asynchronous activity.
154  *
155  * Revision 1.5  1995/04/17  11:28:18  quinn
156  * Smallish
157  *
158  * Revision 1.4  1995/04/10  10:22:47  quinn
159  * Added SCAN
160  *
161  * Revision 1.3  1995/03/30  12:18:09  quinn
162  * Added info.
163  *
164  * Revision 1.2  1995/03/30  10:26:48  quinn
165  * Added Term structure
166  *
167  * Revision 1.1  1995/03/30  09:39:42  quinn
168  * Moved .h files to include directory
169  *
170  * Revision 1.11  1995/03/30  09:08:44  quinn
171  * Added Resource control protocol
172  *
173  * Revision 1.10  1995/03/29  15:39:39  quinn
174  * Adding some resource control elements, and a null-check to getentbyoid
175  *
176  * Revision 1.9  1995/03/29  08:06:18  quinn
177  * Added a few v3 elements
178  *
179  * Revision 1.8  1995/03/22  10:12:49  quinn
180  * Added Z_PRES constants.
181  *
182  * Revision 1.7  1995/03/20  09:45:12  quinn
183  * Working towards v3
184  *
185  * Revision 1.5  1995/03/07  16:29:34  quinn
186  * Added authentication stuff.
187  *
188  * Revision 1.4  1995/03/07  10:13:00  quinn
189  * Added prototype for z_APDU()
190  *
191  * Revision 1.3  1995/02/14  11:54:23  quinn
192  * Fixing include.
193  *
194  * Revision 1.2  1995/02/09  15:51:40  quinn
195  * Works better now.
196  *
197  * Revision 1.1  1995/02/06  16:44:48  quinn
198  * First hack at Z/SR protocol
199  *
200  */
201
202 #ifndef PROTO_H
203 #define PROTO_H
204
205 #include <yconfig.h>
206 #include <odr.h>
207 #include <oid.h>
208 #include <odr_use.h>
209 #include <yaz-version.h>
210
211 #ifdef __cplusplus
212 extern "C" {
213 #endif
214
215 /*
216  * Because we didn't have time to put all of the extra v3 elements in here
217  * before the first applications were written, we have to place them
218  * in #ifdefs in places where they would break existing code. If you are
219  * developing new stuff, we urge you to leave them in, even if you don't
220  * intend to use any v3 features. When we are comfortable that the old
221  * apps have been updated, we'll remove the #ifdefs.
222  */
223
224 #define Z_95
225
226 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
227
228 struct Z_External;
229 typedef struct Z_External Z_External;
230
231 typedef Odr_oct Z_ReferenceId;
232 typedef char Z_DatabaseName;
233 typedef char Z_ResultSetId;
234 typedef Odr_oct Z_ResultsetId;
235
236 typedef struct Z_InfoCategory
237 {
238     Odr_oid *categoryTypeId;         /* OPTIONAL */
239     int *categoryValue;
240 } Z_InfoCategory;
241
242 typedef struct Z_OtherInformationUnit
243 {
244     Z_InfoCategory *category;        /* OPTIONAL */
245     int which;
246 #define Z_OtherInfo_characterInfo 0
247 #define Z_OtherInfo_binaryInfo 1
248 #define Z_OtherInfo_externallyDefinedInfo 2
249 #define Z_OtherInfo_oid 3
250     union
251     {
252         char *characterInfo; 
253         Odr_oct *binaryInfo;
254         Z_External *externallyDefinedInfo;
255         Odr_oid *oid;
256     } information;
257 } Z_OtherInformationUnit;
258
259 typedef struct Z_OtherInformation
260 {
261     int num_elements;
262     Z_OtherInformationUnit **list;
263 } Z_OtherInformation;
264
265 typedef struct Z_StringOrNumeric
266 {
267     int which;
268 #define Z_StringOrNumeric_string 0
269 #define Z_StringOrNumeric_numeric 1
270     union
271     {
272         char *string;
273         int *numeric;
274     } u;
275 } Z_StringOrNumeric;
276
277 typedef struct Z_Unit
278 {
279     char *unitSystem;               /* OPTIONAL */
280     Z_StringOrNumeric *unitType;    /* OPTIONAL */
281     Z_StringOrNumeric *unit;        /* OPTIONAL */
282     int *scaleFactor;               /* OPTIONAL */
283 } Z_Unit;
284
285 typedef struct Z_IntUnit
286 {
287     int *value;
288     Z_Unit *unitUsed;
289 } Z_IntUnit;
290
291 typedef Odr_oct Z_SUTRS;
292
293 typedef struct Z_StringList
294 {
295     int num_strings;
296     char **strings;
297 } Z_StringList;
298
299 /* ----------------- INIT SERVICE  ----------------*/
300
301 typedef struct
302 {
303     char *groupId;       /* OPTIONAL */
304     char *userId;         /* OPTIONAL */
305     char *password;      /* OPTIONAL */
306 } Z_IdPass;
307
308 typedef struct Z_IdAuthentication
309 {
310     int which;
311 #define Z_IdAuthentication_open 0
312 #define Z_IdAuthentication_idPass 1
313 #define Z_IdAuthentication_anonymous 2
314 #define Z_IdAuthentication_other 3
315     union
316     {
317         char *open;
318         Z_IdPass *idPass;
319         Odr_null *anonymous;
320         Z_External *other;
321     } u;
322 } Z_IdAuthentication;
323
324 #define Z_ProtocolVersion_1               0
325 #define Z_ProtocolVersion_2               1
326 #define Z_ProtocolVersion_3               2
327
328 #define Z_Options_search                  0
329 #define Z_Options_present                 1
330 #define Z_Options_delSet                  2
331 #define Z_Options_resourceReport          3
332 #define Z_Options_triggerResourceCtrl     4
333 #define Z_Options_resourceCtrl            5
334 #define Z_Options_accessCtrl              6
335 #define Z_Options_scan                    7
336 #define Z_Options_sort                    8
337 #define Z_Options_reserved                9
338 #define Z_Options_extendedServices       10
339 #define Z_Options_level_1Segmentation    11
340 #define Z_Options_level_2Segmentation    12
341 #define Z_Options_concurrentOperations   13
342 #define Z_Options_namedResultSets        14
343
344 typedef struct Z_InitRequest
345 {
346     Z_ReferenceId *referenceId;                   /* OPTIONAL */
347     Odr_bitmask *protocolVersion;
348     Odr_bitmask *options;
349     int *preferredMessageSize;
350     int *maximumRecordSize;
351     Z_IdAuthentication* idAuthentication;        /* OPTIONAL */
352     char *implementationId;                      /* OPTIONAL */
353     char *implementationName;                    /* OPTIONAL */
354     char *implementationVersion;                 /* OPTIONAL */
355     Z_External *userInformationField;          /* OPTIONAL */
356 #ifdef Z_95
357     Z_OtherInformation *otherInfo;               /* OPTIONAL */
358 #endif
359 } Z_InitRequest;
360
361 typedef struct Z_InitResponse
362 {
363     Z_ReferenceId *referenceId;    /* OPTIONAL */
364     Odr_bitmask *protocolVersion;
365     Odr_bitmask *options;
366     int *preferredMessageSize;
367     int *maximumRecordSize;
368     bool_t *result;
369     char *implementationId;      /* OPTIONAL */
370     char *implementationName;    /* OPTIONAL */
371     char *implementationVersion; /* OPTIONAL */
372     Z_External *userInformationField; /* OPTIONAL */
373 #ifdef Z_95
374     Z_OtherInformation *otherInfo;    /* OPTIONAL */
375 #endif
376 } Z_InitResponse;
377
378 typedef struct Z_NSRAuthentication
379 {
380     char *user;
381     char *password;
382     char *account;
383 } Z_NSRAuthentication;
384
385 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
386
387 int z_StrAuthentication(ODR o, char **p, int opt);
388
389 /* ------------------ SEARCH SERVICE ----------------*/
390
391 typedef struct Z_DatabaseSpecificUnit
392 {
393     char *databaseName;
394     char *elementSetName;
395 } Z_DatabaseSpecificUnit;
396
397 typedef struct Z_DatabaseSpecific
398 {
399     int num_elements;
400     Z_DatabaseSpecificUnit **elements;
401 } Z_DatabaseSpecific;
402
403 typedef struct Z_ElementSetNames
404 {
405     int which;
406 #define Z_ElementSetNames_generic 0
407 #define Z_ElementSetNames_databaseSpecific 1
408     union
409     {
410         char *generic;
411         Z_DatabaseSpecific *databaseSpecific;
412     } u;
413 } Z_ElementSetNames;
414
415 /* ---------------------- RPN QUERY --------------------------- */
416
417 typedef struct Z_ComplexAttribute
418 {
419     int num_list;
420     Z_StringOrNumeric **list;
421     int num_semanticAction;
422     int **semanticAction;           /* OPTIONAL */
423 } Z_ComplexAttribute;
424
425 typedef struct Z_AttributeElement
426 {
427 #ifdef Z_95
428     Odr_oid *attributeSet;           /* OPTIONAL - v3 only */
429 #endif
430     int *attributeType;
431 #ifdef Z_95
432     int which;
433 #define Z_AttributeValue_numeric 0
434 #define Z_AttributeValue_complex 1
435     union
436     {
437         int *numeric;
438         Z_ComplexAttribute *complex;
439     } value;
440 #else
441     int *attributeValue;
442 #endif
443 } Z_AttributeElement;
444
445 typedef struct Z_Term 
446 {
447     int which;
448 #define Z_Term_general 0
449 #define Z_Term_numeric 1
450 #define Z_Term_characterString 2
451 #define Z_Term_oid 3
452 #define Z_Term_dateTime 4
453 #define Z_Term_external 5
454 #define Z_Term_integerAndUnit 6
455 #define Z_Term_null 7
456     union
457     {
458         Odr_oct *general; /* this is required for v2 */
459         int *numeric;
460         char *characterString;
461         Odr_oid *oid;
462         char *dateTime;
463         Z_External *external;
464         /* Z_IntUnit *integerAndUnit; */
465         Odr_null *null;
466     } u;
467 } Z_Term;
468
469 typedef struct Z_AttributesPlusTerm
470 {
471     int num_attributes;
472     Z_AttributeElement **attributeList;
473     Z_Term *term;
474 } Z_AttributesPlusTerm;
475
476 typedef struct Z_ResultSetPlusAttributes
477 {
478     char *resultSet;
479     int num_attributes;
480     Z_AttributeElement **attributeList;
481 } Z_ResultSetPlusAttributes;
482
483 typedef struct Z_ProximityOperator
484 {
485     bool_t *exclusion;          /* OPTIONAL */
486     int *distance;
487     bool_t *ordered;
488     int *relationType;
489 #define Z_Prox_lessThan           1
490 #define Z_Prox_lessThanOrEqual    2
491 #define Z_Prox_equal              3
492 #define Z_Prox_greaterThanOrEqual 4
493 #define Z_Prox_greaterThan        5
494 #define Z_Prox_notEqual           6
495     int which;
496 #define Z_ProxCode_known 0
497 #define Z_ProxCode_private 1
498     int *proximityUnitCode;
499 #define Z_ProxUnit_character       1
500 #define Z_ProxUnit_word            2
501 #define Z_ProxUnit_sentence        3
502 #define Z_ProxUnit_paragraph       4
503 #define Z_ProxUnit_section         5
504 #define Z_ProxUnit_chapter         6
505 #define Z_ProxUnit_document        7
506 #define Z_ProxUnit_element         8
507 #define Z_ProxUnit_subelement      9
508 #define Z_ProxUnit_elementType    10
509 #define Z_ProxUnit_byte           11   /* v3 only */
510 } Z_ProximityOperator;
511
512 typedef struct Z_Operator
513 {
514     int which;
515 #define Z_Operator_and 0
516 #define Z_Operator_or 1
517 #define Z_Operator_and_not 2
518 #define Z_Operator_prox 3
519     union
520     {
521         Odr_null *and;          /* these guys are nulls. */
522         Odr_null *or;
523         Odr_null *and_not;
524         Z_ProximityOperator *prox;
525     } u;
526 } Z_Operator;
527
528 typedef struct Z_Operand
529 {
530     int which;
531 #define Z_Operand_APT 0
532 #define Z_Operand_resultSetId 1
533 #define Z_Operand_resultAttr             /* v3 only */ 2
534     union
535     {
536         Z_AttributesPlusTerm *attributesPlusTerm;
537         Z_ResultSetId *resultSetId;
538         Z_ResultSetPlusAttributes *resultAttr;
539     } u;
540 } Z_Operand;
541
542 typedef struct Z_Complex
543 {
544     struct Z_RPNStructure *s1;
545     struct Z_RPNStructure *s2;
546     Z_Operator *roperator;
547 } Z_Complex;
548
549 typedef struct Z_RPNStructure
550 {
551     int which;
552 #define Z_RPNStructure_simple 0
553 #define Z_RPNStructure_complex 1
554     union
555     {
556         Z_Operand *simple;
557         Z_Complex *complex;
558     } u;
559 } Z_RPNStructure;
560
561 typedef struct Z_RPNQuery
562 {
563     Odr_oid *attributeSetId;
564     Z_RPNStructure *RPNStructure;
565 } Z_RPNQuery;
566
567 /* -------------------------- SEARCHREQUEST -------------------------- */
568
569 typedef struct Z_Query
570 {
571     int which;
572 #define Z_Query_type_1 1
573 #define Z_Query_type_2 2
574 #define Z_Query_type_101 3
575     union
576     {
577         Z_RPNQuery *type_1;
578         Odr_oct *type_2;
579         Z_RPNQuery *type_101;
580     } u;
581 } Z_Query;
582
583 typedef struct Z_SearchRequest
584 {
585     Z_ReferenceId *referenceId;   /* OPTIONAL */
586     int *smallSetUpperBound;
587     int *largeSetLowerBound;
588     int *mediumSetPresentNumber;
589     bool_t *replaceIndicator;
590     char *resultSetName;
591     int num_databaseNames;
592     char **databaseNames;
593     Z_ElementSetNames *smallSetElementSetNames;    /* OPTIONAL */
594     Z_ElementSetNames *mediumSetElementSetNames;    /* OPTIONAL */
595     Odr_oid *preferredRecordSyntax;  /* OPTIONAL */
596     Z_Query *query;
597 #ifdef Z_95
598     Z_OtherInformation *additionalSearchInfo;       /* OPTIONAL */
599     Z_OtherInformation *otherInfo;                  /* OPTIONAL */
600 #endif
601 } Z_SearchRequest;
602
603 /* ------------------------ RECORD -------------------------- */
604
605 typedef Z_External Z_DatabaseRecord;
606
607 #ifdef Z_95
608
609 typedef struct Z_DefaultDiagFormat
610 {
611     Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
612     int *condition;
613     /* until the whole character set issue becomes more definite,
614      * you can probably ignore this on input. */
615     int which;
616 #define Z_DiagForm_v2AddInfo 0
617 #define Z_DiagForm_v3AddInfo 1
618     char *addinfo;
619 } Z_DefaultDiagFormat;
620
621 typedef struct Z_DiagRec
622 {
623     int which;
624 #define Z_DiagRec_defaultFormat 0
625 #define Z_DiagRec_externallyDefined 1
626     union
627     {
628         Z_DefaultDiagFormat *defaultFormat;
629         Z_External *externallyDefined;
630     } u;
631 } Z_DiagRec;
632
633 #else
634
635 typedef struct Z_DiagRec
636 {
637     Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
638     int *condition;
639     char *addinfo;
640 } Z_DiagRec;
641
642 #endif
643
644 typedef struct Z_DiagRecs
645 {
646     int num_diagRecs;
647     Z_DiagRec **diagRecs;
648 } Z_DiagRecs;
649
650 typedef struct Z_NamePlusRecord
651 {
652     char *databaseName;      /* OPTIONAL */
653     int which;
654 #define Z_NamePlusRecord_databaseRecord 0
655 #define Z_NamePlusRecord_surrogateDiagnostic 1
656     union
657     {
658         Z_DatabaseRecord *databaseRecord;
659         Z_DiagRec *surrogateDiagnostic;
660     } u;
661 } Z_NamePlusRecord;
662
663 typedef struct Z_NamePlusRecordList
664 {
665     int num_records;
666     Z_NamePlusRecord **records;
667 } Z_NamePlusRecordList;
668
669 typedef struct Z_Records
670 {
671     int which;
672 #define Z_Records_DBOSD 0
673 #define Z_Records_NSD 1
674 #define Z_Records_multipleNSD 2
675     union
676     {
677         Z_NamePlusRecordList *databaseOrSurDiagnostics;
678         Z_DiagRec *nonSurrogateDiagnostic;
679         Z_DiagRecs *multipleNonSurDiagnostics;
680     } u;
681 } Z_Records;
682
683 /* ------------------------ SEARCHRESPONSE ------------------ */
684
685 typedef struct Z_SearchResponse
686 {
687     Z_ReferenceId *referenceId;       /* OPTIONAL */
688     int *resultCount;
689     int *numberOfRecordsReturned;
690     int *nextResultSetPosition;
691     bool_t *searchStatus;
692     int *resultSetStatus;              /* OPTIONAL */
693 #define Z_RES_SUBSET        1
694 #define Z_RES_INTERIM       2
695 #define Z_RES_NONE          3
696     int *presentStatus;                /* OPTIONAL */
697 #define Z_PRES_SUCCESS      0
698 #define Z_PRES_PARTIAL_1    1
699 #define Z_PRES_PARTIAL_2    2
700 #define Z_PRES_PARTIAL_3    3
701 #define Z_PRES_PARTIAL_4    4
702 #define Z_PRES_FAILURE      5
703     Z_Records *records;                  /* OPTIONAL */
704 #ifdef Z_95
705     Z_OtherInformation *additionalSearchInfo;
706     Z_OtherInformation *otherInfo;
707 #endif
708 } Z_SearchResponse;
709
710 /* ------------------------- PRESENT SERVICE -----------------*/
711
712 typedef struct Z_ElementSpec
713 {
714     int which;
715 #define Z_ElementSpec_elementSetName 0
716 #define Z_ElementSpec_externalSpec 1
717     union
718     {
719         char *elementSetName;
720         Z_External *externalSpec;
721     } u;
722 } Z_ElementSpec;
723
724 typedef struct Z_Specification
725 {
726     Odr_oid *schema;                  /* OPTIONAL */
727     Z_ElementSpec *elementSpec;       /* OPTIONAL */
728 } Z_Specification;
729
730 typedef struct Z_DbSpecific
731 {
732     char *databaseName;
733     Z_Specification *spec;
734 } Z_DbSpecific;
735
736 typedef struct Z_CompSpec
737 {
738     bool_t *selectAlternativeSyntax;
739     Z_Specification *generic;            /* OPTIONAL */
740     int num_dbSpecific;
741     Z_DbSpecific **dbSpecific;           /* OPTIONAL */
742     int num_recordSyntax;
743     Odr_oid **recordSyntax;              /* OPTIONAL */
744 } Z_CompSpec;
745
746 typedef struct Z_RecordComposition
747 {
748     int which;
749 #define Z_RecordComp_simple 0
750 #define Z_RecordComp_complex 1
751     union
752     {
753         Z_ElementSetNames *simple;
754         Z_CompSpec *complex;
755     } u;
756 } Z_RecordComposition;
757
758 typedef struct Z_Range
759 {
760     int *startingPosition;
761     int *numberOfRecords;
762 } Z_Range;
763
764 typedef struct Z_PresentRequest
765 {
766     Z_ReferenceId *referenceId;              /* OPTIONAL */
767     Z_ResultSetId *resultSetId;
768     int *resultSetStartPoint;
769     int *numberOfRecordsRequested;
770 #ifdef Z_95
771     int num_ranges;
772     Z_Range **additionalRanges;              /* OPTIONAL */
773     Z_RecordComposition *recordComposition;  /* OPTIONAL */
774 #else
775     Z_ElementSetNames *elementSetNames;  /* OPTIONAL */
776 #endif
777     Odr_oid *preferredRecordSyntax;  /* OPTIONAL */
778 #ifdef Z_95
779     int *maxSegmentCount;                 /* OPTIONAL */
780     int *maxRecordSize;                   /* OPTIONAL */
781     int *maxSegmentSize;                  /* OPTIONAL */
782     Z_OtherInformation *otherInfo;        /* OPTIONAL */
783 #endif
784 } Z_PresentRequest;
785
786 typedef struct Z_PresentResponse
787 {
788     Z_ReferenceId *referenceId;        /* OPTIONAL */
789     int *numberOfRecordsReturned;
790     int *nextResultSetPosition;
791     int *presentStatus;
792     Z_Records *records;
793 #ifdef Z_95
794     Z_OtherInformation *otherInfo;     /* OPTIONAL */
795 #endif
796 } Z_PresentResponse;
797
798 /* ------------------ RESOURCE CONTROL ----------------*/
799
800 typedef struct Z_TriggerResourceControlRequest
801 {
802     Z_ReferenceId *referenceId;    /* OPTIONAL */
803     int *requestedAction;
804 #define Z_TriggerResourceCtrl_resourceReport  1
805 #define Z_TriggerResourceCtrl_resourceControl 2
806 #define Z_TriggerResourceCtrl_cancel          3
807     Odr_oid *prefResourceReportFormat;  /* OPTIONAL */
808     bool_t *resultSetWanted;            /* OPTIONAL */
809 #ifdef Z_95
810     Z_OtherInformation *otherInfo;
811 #endif
812 } Z_TriggerResourceControlRequest;
813
814 typedef struct Z_ResourceControlRequest
815 {
816     Z_ReferenceId *referenceId;    /* OPTIONAL */
817     bool_t *suspendedFlag;         /* OPTIONAL */
818     Z_External *resourceReport; /* OPTIONAL */
819     int *partialResultsAvailable;  /* OPTIONAL */
820 #define Z_ResourceControlRequest_subset    1
821 #define Z_ResourceControlRequest_interim   2
822 #define Z_ResourceControlRequest_none      3
823     bool_t *responseRequired;
824     bool_t *triggeredRequestFlag;  /* OPTIONAL */
825 #ifdef Z_95
826     Z_OtherInformation *otherInfo;
827 #endif
828 } Z_ResourceControlRequest;
829
830 typedef struct Z_ResourceControlResponse
831 {
832     Z_ReferenceId *referenceId;    /* OPTIONAL */
833     bool_t *continueFlag;
834     bool_t *resultSetWanted;       /* OPTIONAL */
835 #ifdef Z_95
836     Z_OtherInformation *otherInfo;
837 #endif
838 } Z_ResourceControlResponse;
839
840
841 /* ------------------ ACCESS CTRL SERVICE ----------------*/
842
843 typedef struct Z_AccessControlRequest
844 {
845     Z_ReferenceId *referenceId;           /* OPTIONAL */
846     int which;
847 #define Z_AccessRequest_simpleForm 0
848 #define Z_AccessRequest_externallyDefined 1
849     union
850     {
851         Odr_oct *simpleForm;
852         Z_External *externallyDefined;
853     } u;
854 #ifdef Z_95
855     Z_OtherInformation *otherInfo;           /* OPTIONAL */
856 #endif
857 } Z_AccessControlRequest;
858
859 typedef struct Z_AccessControlResponse
860 {
861     Z_ReferenceId *referenceId;              /* OPTIONAL */
862     int which;
863 #define Z_AccessResponse_simpleForm 0
864 #define Z_AccessResponse_externallyDefined 1
865     union
866     {
867         Odr_oct *simpleForm;
868         Z_External *externallyDefined;
869     } u;
870     Z_DiagRec *diagnostic;                   /* OPTIONAL */
871 #ifdef Z_95
872     Z_OtherInformation *otherInfo;           /* OPTIONAL */
873 #endif
874 } Z_AccessControlResponse;
875
876 /* ------------------------ SCAN SERVICE -------------------- */
877
878 typedef struct Z_AttributeList
879 {
880     int num_attributes;
881     Z_AttributeElement **attributes;
882 } Z_AttributeList;
883
884 typedef struct Z_AlternativeTerm
885 {
886     int num_terms;
887     Z_AttributesPlusTerm **terms;
888 } Z_AlternativeTerm;
889
890 typedef struct Z_ByDatabase
891 {
892     char *db;
893     int *num;                           /* OPTIONAL */
894     Z_OtherInformation *otherDbInfo;    /* OPTIONAL */
895 } Z_ByDatabase;
896
897 typedef struct Z_ByDatabaseList
898 {
899     int num_elements;
900     Z_ByDatabase **elements;
901 } Z_ByDatabaseList;
902
903 typedef struct Z_ScanOccurrences
904 {
905     int which;
906 #define Z_ScanOccurrences_global         0
907 #define Z_ScanOccurrences_byDatabase     1
908     union
909     {
910         int *global;
911         Z_ByDatabaseList *byDatabase;
912     } u;
913
914 } Z_ScanOccurrences;
915
916 typedef struct Z_OccurrenceByAttributesElem
917 {
918     Z_AttributeList *attributes;
919     Z_ScanOccurrences *occurrences;         /* OPTIONAL */
920     Z_OtherInformation *otherOccurInfo;      /* OPTIONAL */
921 } Z_OccurrenceByAttributesElem;
922
923 typedef struct Z_OccurrenceByAttributes
924 {
925     int num_elements;
926     Z_OccurrenceByAttributesElem **elements;
927 } Z_OccurrenceByAttributes;
928
929 typedef struct Z_TermInfo
930 {
931     Z_Term *term;
932     char *displayTerm;                     /* OPTIONAL */
933     Z_AttributeList *suggestedAttributes;  /* OPTIONAL */
934     Z_AlternativeTerm *alternativeTerm;    /* OPTIONAL */
935     int *globalOccurrences;                /* OPTIONAL */
936     Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
937     Z_OtherInformation *otherTermInfo;      /* OPTIONAL */
938 } Z_TermInfo;
939
940 typedef struct Z_Entry
941 {
942     int which;
943 #define Z_Entry_termInfo 0
944 #define Z_Entry_surrogateDiagnostic 1
945     union
946     {
947         Z_TermInfo *termInfo;
948         Z_DiagRec *surrogateDiagnostic;
949     } u;
950 } Z_Entry;
951
952 #ifdef BUGGY_LISTENTRIES
953
954 typedef struct Z_Entries
955 {
956     int num_entries;
957     Z_Entry **entries;
958 } Z_Entries;
959
960 typedef struct Z_ListEntries
961 {
962     int which;
963 #define Z_ListEntries_entries 0
964 #define Z_ListEntries_nonSurrogateDiagnostics 1
965     union
966     {
967         Z_Entries *entries;
968         Z_DiagRecs *nonSurrogateDiagnostics;
969     } u;
970 } Z_ListEntries;
971
972 #endif
973
974 typedef struct Z_ListEntries {
975         int num_entries;
976         Z_Entry **entries; /* OPT */
977         int num_nonsurrogateDiagnostics;
978         Z_DiagRec **nonsurrogateDiagnostics; /* OPT */
979 } Z_ListEntries;
980
981 typedef struct Z_ScanRequest
982 {
983     Z_ReferenceId *referenceId;       /* OPTIONAL */
984     int num_databaseNames;
985     char **databaseNames;
986     Odr_oid *attributeSet;          /* OPTIONAL */
987     Z_AttributesPlusTerm *termListAndStartPoint;
988     int *stepSize;                    /* OPTIONAL */
989     int *numberOfTermsRequested;
990     int *preferredPositionInResponse;   /* OPTIONAL */
991 #ifdef Z_95
992     Z_OtherInformation *otherInfo;
993 #endif
994 } Z_ScanRequest;
995
996 typedef struct Z_ScanResponse
997 {
998     Z_ReferenceId *referenceId;       /* OPTIONAL */
999     int *stepSize;                    /* OPTIONAL */
1000     int *scanStatus;
1001 #define Z_Scan_success      0
1002 #define Z_Scan_partial_1    1
1003 #define Z_Scan_partial_2    2
1004 #define Z_Scan_partial_3    3
1005 #define Z_Scan_partial_4    4
1006 #define Z_Scan_partial_5    5
1007 #define Z_Scan_failure      6
1008     int *numberOfEntriesReturned;
1009     int *positionOfTerm;              /* OPTIONAL */
1010     Z_ListEntries *entries;           /* OPTIONAL */
1011     Odr_oid *attributeSet;            /* OPTIONAL */
1012 #ifdef Z_95
1013     Z_OtherInformation *otherInfo;
1014 #endif
1015 } Z_ScanResponse; 
1016
1017
1018 /* ------------------------ DELETE -------------------------- */
1019
1020 #define Z_DeleteStatus_success                          0
1021 #define Z_DeleteStatus_resultSetDidNotExist             1
1022 #define Z_DeleteStatus_previouslyDeletedByTarget        2
1023 #define Z_DeleteStatus_systemProblemAtTarget            3
1024 #define Z_DeleteStatus_accessNotAllowed                 4
1025 #define Z_DeleteStatus_resourceControlAtOrigin          5
1026 #define Z_DeleteStatus_resourceControlAtTarget          6
1027 #define Z_DeleteStatus_bulkDeleteNotSupported           7
1028 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte  8
1029 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
1030 #define Z_DeleteStatus_resultSetInUse                  10
1031
1032 typedef struct Z_ListStatus
1033 {
1034     Z_ResultSetId *id;
1035     int *status;
1036 } Z_ListStatus;
1037
1038 typedef struct Z_DeleteResultSetRequest
1039 {
1040     Z_ReferenceId *referenceId;        /* OPTIONAL */
1041     int *deleteFunction;
1042 #define Z_DeleteRequest_list    0
1043 #define Z_DeleteRequest_all     1
1044     int num_resultSetList;
1045     Z_ResultSetId **resultSetList;      /* OPTIONAL */
1046 #ifdef Z_95
1047     Z_OtherInformation *otherInfo;
1048 #endif
1049 } Z_DeleteResultSetRequest;
1050
1051 typedef struct Z_ListStatuses {
1052     int num;
1053     Z_ListStatus **elements;
1054 } Z_ListStatuses;
1055
1056 typedef struct Z_DeleteResultSetResponse
1057 {
1058     Z_ReferenceId *referenceId;        /* OPTIONAL */
1059     int *deleteOperationStatus;
1060     Z_ListStatuses *deleteListStatuses;/* OPTIONAL */
1061     int *numberNotDeleted;             /* OPTIONAL */
1062     Z_ListStatuses *bulkStatuses;      /* OPTIONAL */
1063     char *deleteMessage;               /* OPTIONAL */
1064 #ifdef Z_95
1065     Z_OtherInformation *otherInfo;
1066 #endif
1067 } Z_DeleteResultSetResponse;
1068
1069 /* ------------------------ CLOSE SERVICE ------------------- */
1070
1071 typedef struct Z_Close
1072 {
1073     Z_ReferenceId *referenceId;         /* OPTIONAL */
1074     int *closeReason;
1075 #define Z_Close_finished           0
1076 #define Z_Close_shutdown           1
1077 #define Z_Close_systemProblem      2
1078 #define Z_Close_costLimit          3
1079 #define Z_Close_resources          4
1080 #define Z_Close_securityViolation  5
1081 #define Z_Close_protocolError      6
1082 #define Z_Close_lackOfActivity     7
1083 #define Z_Close_peerAbort          8
1084 #define Z_Close_unspecified        9
1085     char *diagnosticInformation;          /* OPTIONAL */
1086     Odr_oid *resourceReportFormat;        /* OPTIONAL */
1087     Z_External *resourceReport;         /* OPTIONAL */
1088 #ifdef Z_95
1089     Z_OtherInformation *otherInfo;        /* OPTIONAL */
1090 #endif
1091 } Z_Close;
1092
1093 /* ------------------------ SEGMENTATION -------------------- */
1094
1095 typedef struct Z_Segment
1096 {
1097     Z_ReferenceId *referenceId;   /* OPTIONAL */
1098     int *numberOfRecordsReturned;
1099     int num_segmentRecords;
1100     Z_NamePlusRecord **segmentRecords;
1101     Z_OtherInformation *otherInfo;  /* OPTIONAL */
1102 } Z_Segment;
1103
1104 /* ----------------------- Extended Services ---------------- */
1105
1106 typedef struct Z_Permissions
1107 {
1108     char *userId;                         
1109     int num_allowableFunctions;
1110     int **allowableFunctions;             
1111 #define Z_Permissions_delete              1
1112 #define Z_Permissions_modifyContents      2
1113 #define Z_Permissions_modifyPermissions   3
1114 #define Z_Permissions_present             4
1115 #define Z_Permissions_invoke              5
1116 } Z_Permissions;
1117
1118 typedef struct Z_ExtendedServicesRequest
1119 {
1120     Z_ReferenceId *referenceId;             /* OPTIONAL */
1121     int *function;                        
1122 #define Z_ExtendedServicesRequest_create              1
1123 #define Z_ExtendedServicesRequest_delete              2
1124 #define Z_ExtendedServicesRequest_modify              3
1125     Odr_oid *packageType;                 
1126     char *packageName;                      /* OPTIONAL */
1127     char *userId;                           /* OPTIONAL */
1128     Z_IntUnit *retentionTime;               /* OPTIONAL */
1129     Z_Permissions *permissions;             /* OPTIONAL */
1130     char *description;                      /* OPTIONAL */
1131     Z_External *taskSpecificParameters;     /* OPTIONAL */
1132     int *waitAction;                      
1133 #define Z_ExtendedServicesRequest_wait                1
1134 #define Z_ExtendedServicesRequest_waitIfPossible      2
1135 #define Z_ExtendedServicesRequest_dontWait            3
1136 #define Z_ExtendedServicesRequest_dontReturnPackage   4
1137     char *elements;             /* OPTIONAL */
1138     Z_OtherInformation *otherInfo;          /* OPTIONAL */
1139 } Z_ExtendedServicesRequest;
1140
1141 typedef struct Z_ExtendedServicesResponse
1142 {
1143     Z_ReferenceId *referenceId;             /* OPTIONAL */
1144     int *operationStatus;                 
1145 #define Z_ExtendedServicesResponse_done                1
1146 #define Z_ExtendedServicesResponse_accepted            2
1147 #define Z_ExtendedServicesResponse_failure             3
1148     int num_diagnostics;
1149     Z_DiagRec **diagnostics;                /* OPTIONAL */
1150     Z_External *taskPackage;                /* OPTIONAL */
1151     Z_OtherInformation *otherInfo;          /* OPTIONAL */
1152 } Z_ExtendedServicesResponse;
1153
1154 /* ------------------------ Sort --------------------------- */
1155
1156 typedef struct Z_SortAttributes
1157 {
1158     Odr_oid *id;
1159     Z_AttributeList *list;
1160 } Z_SortAttributes;
1161
1162 typedef struct Z_SortKey
1163 {
1164     int which;
1165 #define Z_SortKey_sortField             0
1166 #define Z_SortKey_elementSpec           1
1167 #define Z_SortKey_sortAttributes        2
1168     union
1169     {
1170         char *sortField;
1171         Z_Specification *elementSpec;
1172         Z_SortAttributes *sortAttributes;
1173     } u;
1174 } Z_SortKey;
1175
1176 typedef struct Z_SortDbSpecific
1177 {
1178     char *databaseName;
1179     Z_SortKey *dbSort;
1180 } Z_SortDbSpecific;
1181
1182 typedef struct Z_SortDbSpecificList
1183 {
1184     int num_dbSpecific;
1185     Z_SortDbSpecific **dbSpecific;
1186 } Z_SortDbSpecificList;
1187
1188 typedef struct Z_SortElement
1189 {
1190     int which;
1191 #define Z_SortElement_generic               0
1192 #define Z_SortElement_databaseSpecific      1
1193     union
1194     {
1195         Z_SortKey *generic;
1196         Z_SortDbSpecificList *databaseSpecific;
1197     } u;
1198 } Z_SortElement;
1199
1200 typedef struct Z_SortMissingValueAction
1201 {
1202     int which;
1203 #define Z_SortMissingValAct_abort           0
1204 #define Z_SortMissingValAct_null            1
1205 #define Z_SortMissingValAct_valData         2
1206     union
1207     {
1208         Odr_null *abort;
1209         Odr_null *null;
1210         Odr_oct *valData;
1211     } u;
1212 } Z_SortMissingValueAction;
1213
1214 typedef struct Z_SortKeySpec
1215 {
1216     Z_SortElement *sortElement;
1217     int *sortRelation;
1218 #define Z_SortRelation_ascending            0
1219 #define Z_SortRelation_descending           1
1220 #define Z_SortRelation_ascendingByFreq      3
1221 #define Z_SortRelation_descendingByFreq     4
1222     int *caseSensitivity;
1223 #define Z_SortCase_caseSensitive            0
1224 #define Z_SortCase_caseInsensitive          1
1225     Z_SortMissingValueAction *missingValueAction;  /* OPTIONAL */
1226 } Z_SortKeySpec;
1227
1228 typedef struct Z_SortResponse
1229 {
1230     Z_ReferenceId *referenceId;             /* OPTIONAL */
1231     int *sortStatus;
1232 #define Z_SortStatus_success              0
1233 #define Z_SortStatus_partial_1            1
1234 #define Z_SortStatus_failure              2
1235     int *resultSetStatus;                   /* OPTIONAL */
1236 #define Z_SortResultSetStatus_empty       1
1237 #define Z_SortResultSetStatus_interim     2
1238 #define Z_SortResultSetStatus_unchanged   3
1239 #define Z_SortResultSetStatus_none        4
1240     Z_DiagRecs *diagnostics;                /* OPTIONAL */
1241     Z_OtherInformation *otherInfo;          /* OPTIONAL */
1242 } Z_SortResponse;
1243
1244 typedef struct Z_SortKeySpecList
1245 {
1246     int num_specs;
1247     Z_SortKeySpec **specs;
1248 } Z_SortKeySpecList;
1249
1250 typedef struct Z_SortRequest
1251 {
1252     Z_ReferenceId *referenceId;             /* OPTIONAL */
1253     Z_StringList *inputResultSetNames;
1254     char *sortedResultSetName;
1255     Z_SortKeySpecList *sortSequence;
1256     Z_OtherInformation *otherInfo;          /* OPTIONAL */
1257 } Z_SortRequest;
1258
1259 /* ----------------------- Resource Report ------------------ */
1260
1261 typedef struct Z_ResourceReportRequest
1262 {
1263     Z_ReferenceId *referenceId;             /* OPTIONAL */
1264     Z_ReferenceId *opId;                    /* OPTIONAL */
1265     Odr_oid *prefResourceReportFormat;      /* OPTIONAL */
1266     Z_OtherInformation *otherInfo;          /* OPTIONAL */
1267 } Z_ResourceReportRequest;
1268
1269 typedef struct Z_ResourceReportResponse
1270 {
1271     Z_ReferenceId *referenceId;             /* OPTIONAL */
1272     int *resourceReportStatus;
1273 #define Z_ResourceReportStatus_success   0
1274 #define Z_ResourceReportStatus_partial   1
1275 #define Z_ResourceReportStatus_failure_1 2
1276 #define Z_ResourceReportStatus_failure_2 3
1277 #define Z_ResourceReportStatus_failure_3 4
1278 #define Z_ResourceReportStatus_failure_4 5
1279 #define Z_ResourceReportStatus_failure_5 6
1280 #define Z_ResourceReportStatus_failure_6 7
1281     Z_External *resourceReport;             /* OPTIONAL */
1282     Z_OtherInformation *otherInfo;          /* OPTIONAL */
1283 } Z_ResourceReportResponse;
1284
1285 /* ------------------------ APDU ---------------------------- */
1286
1287 typedef struct Z_APDU
1288 {    
1289     int which;
1290 #define Z_APDU_initRequest 0
1291 #define Z_APDU_initResponse 1
1292 #define Z_APDU_searchRequest 2
1293 #define Z_APDU_searchResponse 3
1294 #define Z_APDU_presentRequest 4
1295 #define Z_APDU_presentResponse 5
1296 #define Z_APDU_deleteResultSetRequest 6
1297 #define Z_APDU_deleteResultSetResponse 7
1298 #define Z_APDU_resourceControlRequest 8
1299 #define Z_APDU_resourceControlResponse 9
1300 #define Z_APDU_triggerResourceControlRequest 10
1301 #define Z_APDU_scanRequest 11
1302 #define Z_APDU_scanResponse 12
1303 #define Z_APDU_segmentRequest 13
1304 #define Z_APDU_extendedServicesRequest 14
1305 #define Z_APDU_extendedServicesResponse 15
1306 #define Z_APDU_close 16
1307 #define Z_APDU_accessControlRequest 17
1308 #define Z_APDU_accessControlResponse 18
1309 #define Z_APDU_sortRequest 20
1310 #define Z_APDU_sortResponse 21
1311 #define Z_APDU_resourceReportRequest 22
1312 #define Z_APDU_resourceReportResponse 23
1313     union
1314     {
1315         Z_InitRequest  *initRequest;
1316         Z_InitResponse *initResponse;
1317         Z_SearchRequest *searchRequest;
1318         Z_SearchResponse *searchResponse;
1319         Z_PresentRequest *presentRequest;
1320         Z_PresentResponse *presentResponse;
1321         Z_DeleteResultSetRequest *deleteResultSetRequest;
1322         Z_DeleteResultSetResponse *deleteResultSetResponse;
1323         Z_AccessControlRequest *accessControlRequest;
1324         Z_AccessControlResponse *accessControlResponse;
1325         Z_ResourceControlRequest *resourceControlRequest;
1326         Z_ResourceControlResponse *resourceControlResponse;
1327         Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1328         Z_ResourceReportRequest *resourceReportRequest;
1329         Z_ResourceReportResponse *resourceReportResponse;
1330         Z_ScanRequest *scanRequest;
1331         Z_ScanResponse *scanResponse;
1332         Z_SortRequest *sortRequest;
1333         Z_SortResponse *sortResponse;
1334         Z_Segment *segmentRequest;
1335         Z_ExtendedServicesRequest *extendedServicesRequest;
1336         Z_ExtendedServicesResponse *extendedServicesResponse;
1337         Z_Close *close;
1338     } u;
1339 } Z_APDU;
1340
1341 YAZ_EXPORT int z_APDU(ODR o, Z_APDU **p, int opt);
1342 YAZ_EXPORT int z_SUTRS(ODR o, Odr_oct **p, int opt);
1343
1344 YAZ_EXPORT Z_InitRequest *zget_InitRequest(ODR o);
1345 YAZ_EXPORT Z_InitResponse *zget_InitResponse(ODR o);
1346 YAZ_EXPORT Z_SearchRequest *zget_SearchRequest(ODR o);
1347 YAZ_EXPORT Z_SearchResponse *zget_SearchResponse(ODR o);
1348 YAZ_EXPORT Z_PresentRequest *zget_PresentRequest(ODR o);
1349 YAZ_EXPORT Z_PresentResponse *zget_PresentResponse(ODR o);
1350 YAZ_EXPORT Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1351 YAZ_EXPORT Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1352 YAZ_EXPORT Z_ScanRequest *zget_ScanRequest(ODR o);
1353 YAZ_EXPORT Z_ScanResponse *zget_ScanResponse(ODR o);
1354 YAZ_EXPORT Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1355 YAZ_EXPORT Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1356 YAZ_EXPORT Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1357 YAZ_EXPORT Z_Close *zget_Close(ODR o);
1358 YAZ_EXPORT int z_StringList(ODR o, Z_StringList **p, int opt);
1359 YAZ_EXPORT int z_InternationalString(ODR o, char **p, int opt);
1360 YAZ_EXPORT int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt);
1361 YAZ_EXPORT int z_ElementSetName(ODR o, char **p, int opt);
1362 YAZ_EXPORT int z_IntUnit(ODR o, Z_IntUnit **p, int opt);
1363 YAZ_EXPORT int z_Unit(ODR o, Z_Unit **p, int opt);
1364 YAZ_EXPORT int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt);
1365 YAZ_EXPORT int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt);
1366 YAZ_EXPORT int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt);
1367 YAZ_EXPORT int z_Term(ODR o, Z_Term **p, int opt);
1368 YAZ_EXPORT int z_Specification(ODR o, Z_Specification **p, int opt);
1369 YAZ_EXPORT int z_Permissions(ODR o, Z_Permissions **p, int opt);
1370 YAZ_EXPORT int z_DiagRec(ODR o, Z_DiagRec **p, int opt);
1371 YAZ_EXPORT int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt);
1372 YAZ_EXPORT int z_AttributeList(ODR o, Z_AttributeList **p, int opt);
1373 YAZ_EXPORT int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt);
1374 YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which);
1375 YAZ_EXPORT int z_Query(ODR o, Z_Query **p, int opt);
1376
1377 #ifdef __cplusplus
1378 }
1379 #endif
1380
1381 #include <prt-rsc.h>
1382 #include <prt-acc.h>
1383 #include <prt-exp.h>
1384 #include <prt-grs.h>
1385 #include <prt-arc.h>
1386 #include <prt-exd.h>
1387 #include <prt-dia.h>
1388 #include <prt-esp.h>
1389 #include <prt-add.h>
1390
1391 #include <prt-dat.h>
1392 #include <prt-univ.h>
1393 #include <prt-ext.h>
1394
1395 #endif