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