Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
[yaz-moved-to-github.git] / include / prt-exp.h
1 /*
2  * Copyright (c) 1995, 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 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.
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  */
27
28 #ifndef PRT_EXP_H
29 #define PRT_EXP_H
30
31 #include <yconfig.h>
32
33 #define multipleDbSearch multipleDBsearch
34
35 typedef struct Z_CommonInfo
36 {
37     char *dateAdded;           /* OPTIONAL */
38     char *dateChanged;         /* OPTIONAL */
39     char *expiry;              /* OPTIONAL */
40     char *humanStringLanguage;    /* OPTIONAL */
41     Z_OtherInformation *otherInfo;          /* OPTIONAL */
42 } Z_CommonInfo;
43
44 typedef struct Z_HumanStringUnit
45 {
46     char *language;               /* OPTIONAL */
47     char *text;
48 } Z_HumanStringUnit;
49
50 typedef struct Z_HumanString
51 {
52     int num_strings;
53     Z_HumanStringUnit **strings;
54 } Z_HumanString;
55
56 typedef struct Z_IconObjectUnit
57 {
58     int which;
59 #define Z_IconObject_ianaType 0
60 #define Z_IconObject_z3950type 1
61 #define Z_IconObject_otherType 2
62     char *bodyType;
63     Odr_oct *content;
64 } Z_IconObjectUnit;
65
66 typedef struct Z_IconObject
67 {
68     int num_iconUnits;
69     Z_IconObjectUnit **iconUnits;
70 } Z_IconObject;
71
72 typedef struct Z_ContactInfo
73 {
74     char *name;                             /* OPTIONAL */
75     Z_HumanString *description;             /* OPTIONAL */
76     Z_HumanString *address;                 /* OPTIONAL */
77     char *email;                            /* OPTIONAL */
78     char *phone;                            /* OPTIONAL */
79 } Z_ContactInfo;
80
81 typedef struct Z_NetworkAddressIA
82 {
83     char *hostAddress;
84     int *port;
85 } Z_NetworkAddressIA;
86
87 typedef struct Z_NetworkAddressOPA
88 {
89     char *pSel;
90     char *sSel;                  /* OPTIONAL */
91     char *tSel;                  /* OPTIONAL */
92     char *nSap;
93 } Z_NetworkAddressOPA;
94
95 typedef struct Z_NetworkAddressOther
96 {
97     char *type;
98     char *address;
99 } Z_NetworkAddressOther;
100
101 typedef struct Z_NetworkAddress
102 {
103     int which;
104 #define Z_NetworkAddress_iA 0
105 #define Z_NetworkAddress_oPA 1
106 #define Z_NetworkAddress_other 2
107     union
108     {
109         Z_NetworkAddressIA *internetAddress;
110         Z_NetworkAddressOPA *osiPresentationAddress;
111         Z_NetworkAddressOther *other;
112     } u;
113 } Z_NetworkAddress;
114
115 typedef struct Z_PrivateCapOperator
116 {
117     char *operator;
118     Z_HumanString *description;             /* OPTIONAL */
119 } Z_PrivateCapOperator;
120     
121 typedef struct Z_SearchKey
122 {
123     char *searchKey;
124     Z_HumanString *description;             /* OPTIONAL */
125 } Z_SearchKey;
126
127 typedef struct Z_PrivateCapabilities
128 {
129     int num_operators;
130     Z_PrivateCapOperator **operators;      /* OPTIONAL */
131     int num_searchKeys;
132     Z_SearchKey **searchKeys;               /* OPTIONAL */
133     int num_description;
134     Z_HumanString **description;            /* OPTIONAL */
135 } Z_PrivateCapabilities;
136
137 typedef struct Z_ProxSupportPrivate
138 {
139     int *unit;
140     Z_HumanString *description;             /* OPTIONAL */
141 } Z_ProxSupportPrivate;
142
143 typedef struct Z_ProxSupportUnit
144 {
145     int which;
146 #define Z_ProxSupportUnit_known 0
147 #define Z_ProxSupportUnit_private 1
148     union
149     {
150         int known;
151         Z_ProxSupportPrivate *private;
152     } u;
153 } Z_ProxSupportUnit;
154
155 typedef struct Z_ProximitySupport
156 {
157     bool_t *anySupport;
158     int num_unitsSupported;
159     Z_ProxSupportUnit **unitsSupported;     /* OPTIONAL */
160 } Z_ProximitySupport;
161
162 typedef struct Z_RpnCapabilities
163 {
164     int num_operators;
165     int **operators;                        /* OPTIONAL */
166     bool_t *resultSetAsOperandSupported;
167     bool_t *restrictionOperandSupported;
168     Z_ProximitySupport *proximity;          /* OPTIONAL */
169 } Z_RpnCapabilities;
170
171 typedef struct Z_Iso8777Capabilities
172 {
173     int num_searchKeys;
174     Z_SearchKey **searchKeys;
175     Z_HumanString *restrictions;            /* OPTIONAL */
176 } Z_Iso8777Capabilities;
177
178 typedef struct Z_QueryTypeDetails
179 {
180     int which;
181 #define Z_QueryTypeDetails_private 0
182 #define Z_QueryTypeDetails_rpn 1
183 #define Z_QueryTypeDetails_iso8777 2
184 #define Z_QueryTypeDetails_z3958 3
185 #define Z_QueryTypeDetails_erpn 4
186 #define Z_QueryTypeDetails_rankedList 5
187     union
188     {
189         Z_PrivateCapabilities *private;
190         Z_RpnCapabilities *rpn;
191         Z_Iso8777Capabilities *iso8777;
192         Z_HumanString *z3958;
193         Z_RpnCapabilities *erpn;
194         Z_HumanString *rankedList;
195     } u;
196 } Z_QueryTypeDetails;
197
198 typedef struct Z_AccessRestrictionsUnit
199 {
200     int *accessType;
201 #define Z_AccessRestrictions_any                 0
202 #define Z_AccessRestrictions_search              1
203 #define Z_AccessRestrictions_present             2
204 #define Z_AccessRestrictions_specific_elements   3
205 #define Z_AccessRestrictions_extended_services   4
206 #define Z_AccessRestrictions_by_database         5
207     Z_HumanString *accessText;              /* OPTIONAL */
208     int num_accessChallenges;
209     Odr_oid **accessChallenges;             /* OPTIONAL */
210 } Z_AccessRestrictionsUnit;
211
212 typedef struct Z_AccessRestrictions
213 {
214     int num_restrictions;
215     Z_AccessRestrictionsUnit **restrictions;
216 } Z_AccessRestrictions;
217
218 typedef struct Z_Charge
219 {
220     Z_IntUnit *cost;
221     Z_Unit *perWhat;                        /* OPTIONAL */
222     Z_HumanString *text;                    /* OPTIONAL */
223 } Z_Charge;
224
225 typedef struct Z_CostsOtherCharge
226 {
227     Z_HumanString *forWhat;
228     Z_Charge *charge;
229 } Z_CostsOtherCharge;
230
231 typedef struct Z_Costs
232 {
233     Z_Charge *connectCharge;                /* OPTIONAL */
234     Z_Charge *connectTime;                  /* OPTIONAL */
235     Z_Charge *displayCharge;                /* OPTIONAL */
236     Z_Charge *searchCharge;                 /* OPTIONAL */
237     Z_Charge *subscriptCharge;              /* OPTIONAL */
238     int num_otherCharges;
239     Z_CostsOtherCharge **otherCharges;      /* OPTIONAL */
240 } Z_Costs;
241
242 typedef struct Z_AccessInfo
243 {
244     int num_queryTypesSupported;
245     Z_QueryTypeDetails **queryTypesSupported;  /* OPTIONAL */
246     int num_diagnosticsSets;
247     Odr_oid **diagnosticsSets;              /* OPTIONAL */
248     int num_attributeSetIds;
249     Odr_oid **attributeSetIds;     /* OPTIONAL */
250     int num_schemas;
251     Odr_oid **schemas;                      /* OPTIONAL */
252     int num_recordSyntaxes;
253     Odr_oid **recordSyntaxes;               /* OPTIONAL */
254     int num_resourceChallenges;
255     Odr_oid **resourceChallenges;           /* OPTIONAL */
256     Z_AccessRestrictions *restrictedAccess;  /* OPTIONAL */
257     Z_Costs *costInfo;                      /* OPTIONAL */
258     int num_variantSets;
259     Odr_oid **variantSets;                  /* OPTIONAL */
260     int num_elementSetNames;
261     char **elementSetNames;     /* OPTIONAL */
262     int num_unitSystems;
263     char **unitSystems;                     /* OPTIONAL */
264 } Z_AccessInfo;
265
266 typedef struct Z_DatabaseList
267 {
268     int num_databases;
269     Z_DatabaseName **databases;
270 } Z_DatabaseList;
271
272 typedef struct Z_AttributeValueList
273 {
274     int num_attributes;
275     Z_StringOrNumeric **attributes;
276 } Z_AttributeValueList;
277
278 typedef struct Z_AttributeOccurrence
279 {
280     Odr_oid *attributeSet;         /* OPTIONAL */
281     int *attributeType;
282     Odr_null *mustBeSupplied;               /* OPTIONAL */
283     int which;
284 #define Z_AttributeOcc_anyOrNone 0
285 #define Z_AttributeOcc_specific 1
286     union
287     {
288         Odr_null *anyOrNone;
289         Z_AttributeValueList *specific;
290     } *attributeValues;
291 } Z_AttributeOccurrence;
292
293 typedef struct Z_AttributeCombination
294 {
295     int num_occurrences;
296     Z_AttributeOccurrence **occurrences;
297 } Z_AttributeCombination;
298
299 typedef struct Z_AttributeCombinations
300 {
301     Odr_oid *defaultAttributeSet;
302     int num_legalCombinations;
303     Z_AttributeCombination **legalCombinations;
304 } Z_AttributeCombinations;
305
306 typedef struct Z_AttributeValue
307 {
308     Z_StringOrNumeric *value;
309     Z_HumanString *description;             /* OPTIONAL */
310     int num_subAttributes;
311     Z_StringOrNumeric **subAttributes;      /* OPTIONAL */
312     int num_superAttributes;
313     Z_StringOrNumeric **superAttributes;    /* OPTIONAL */
314     Odr_null *partialSupport;               /* OPTIONAL */
315 } Z_AttributeValue;
316
317 typedef struct Z_TargetInfo
318 {
319     Z_CommonInfo *commonInfo;               /* OPTIONAL */
320     /*
321      * key elements
322      */
323     char *name;
324     /*
325      * non-key brief elements
326      */
327     Z_HumanString *recentNews;             /* OPTIONAL */
328     Z_IconObject *icon;                     /* OPTIONAL */
329     bool_t *namedResultSets;
330     bool_t *multipleDbSearch;
331     int *maxResultSets;                     /* OPTIONAL */
332     int *maxResultSize;                     /* OPTIONAL */
333     int *maxTerms;                          /* OPTIONAL */
334     Z_IntUnit *timeoutInterval;             /* OPTIONAL */
335     Z_HumanString *welcomeMessage;          /* OPTIONAL */
336     /*
337      * non-brief elements
338      */
339     Z_ContactInfo *contactInfo;             /* OPTIONAL */
340     Z_HumanString *description;             /* OPTIONAL */
341     int num_nicknames;
342     char **nicknames;
343     Z_HumanString *usageRest;              /* OPTIONAL */
344     Z_HumanString *paymentAddr;             /* OPTIONAL */
345     Z_HumanString *hours;                   /* OPTIONAL */
346     int num_dbCombinations;
347     Z_DatabaseList **dbCombinations;        /* OPTIONAL */
348     int num_addresses;
349     Z_NetworkAddress **addresses;           /* OPTIONAL */
350     Z_AccessInfo *commonAccessInfo;         /* OPTIONAL */
351 } Z_TargetInfo;
352
353 typedef struct Z_DatabaseInfo
354 {
355     Z_CommonInfo *commonInfo;               /* OPTIONAL */
356     /*
357      * Key elements
358      */
359     Z_DatabaseName *name;
360     /* 
361      * Non-key elements.
362      */
363     Odr_null *explainDatabase;              /* OPTIONAL */
364     int num_nicknames;
365     Z_DatabaseName **nicknames;             /* OPTIONAL */
366     Z_IconObject *icon;                     /* OPTIONAL */
367     bool_t *userFee;
368     bool_t *available;
369     Z_HumanString *titleString;             /* OPTIONAL */
370     /*
371      * Non-brief elements.
372      */
373     int num_keywords;
374     Z_HumanString **keywords;               /* OPTIONAL */
375     Z_HumanString *description;             /* OPTIONAL */
376     Z_DatabaseList *associatedDbs;          /* OPTIONAL */
377     Z_DatabaseList *subDbs;                 /* OPTIONAL */
378     Z_HumanString *disclaimers;             /* OPTIONAL */
379     Z_HumanString *news;                    /* OPTIONAL */
380     int recordCount_which;
381 #define Z_Exp_RecordCount_actualNumber 0
382 #define Z_Exp_RecordCount_approxNumber 1
383     int *recordCount;                       /* OPTIONAL */
384     Z_HumanString *defaultOrder;            /* OPTIONAL */
385     int *avRecordSize;                      /* OPTIONAL */
386     int *maxRecordSize;                     /* OPTIONAL */
387     Z_HumanString *hours;                   /* OPTIONAL */
388     Z_HumanString *bestTime;                /* OPTIONAL */
389     char *lastUpdate;          /* OPTIONAL */
390     Z_IntUnit *updateInterval;              /* OPTIONAL */
391     Z_HumanString *coverage;                /* OPTIONAL */
392     bool_t *proprietary;                    /* OPTIONAL */
393     Z_HumanString *copyrightText;           /* OPTIONAL */
394     Z_HumanString *copyrightNotice;         /* OPTIONAL */
395     Z_ContactInfo *producerContactInfo;     /* OPTIONAL */
396     Z_ContactInfo *supplierContactInfo;     /* OPTIONAL */
397     Z_ContactInfo *submissionContactInfo;   /* OPTIONAL */
398     Z_AccessInfo *accessInfo;               /* OPTIONAL */
399 } Z_DatabaseInfo;
400
401 typedef struct Z_TagTypeMapping
402 {
403     int *tagType;
404     Odr_oid *tagSet;                        /* OPTIONAL */
405     Odr_null *defaultTagType;               /* OPTIONAL */
406 } Z_TagTypeMapping;
407
408 typedef struct Z_PathUnit
409 {
410     int *tagType;
411     Z_StringOrNumeric *tagValue;
412 } Z_PathUnit;
413
414 typedef struct Z_Path
415 {
416     int num;
417     Z_PathUnit **list;
418 } Z_Path;
419
420 struct Z_ElementDataType;
421 typedef struct Z_ElementDataType Z_ElementDataType;
422
423 typedef struct Z_ElementInfo
424 {
425     char *elementName;
426     Z_Path *elementTagPath;
427     Z_ElementDataType *dataType;            /* OPTIONAL */
428     bool_t *required;
429     bool_t *repeatable;
430     Z_HumanString *description;             /* OPTIONAL */
431 } Z_ElementInfo;
432
433 typedef struct Z_ElementInfoList
434 {
435     int num;
436     Z_ElementInfo **list;
437 } Z_ElementInfoList;
438
439 struct Z_ElementDataType
440 {
441     int which;
442 #define Z_ElementDataType_primitive 0
443 #define Z_ElementDataType_structured 1
444     union
445     {
446         int *primitive;
447 #define Z_PrimitiveElement_octetString         0
448 #define Z_PrimitiveElement_numeric             1
449 #define Z_PrimitiveElement_date                2
450 #define Z_PrimitiveElement_external            3
451 #define Z_PrimitiveElement_string              4
452 #define Z_PrimitiveElement_trueOrFalse         5
453 #define Z_PrimitiveElement_oid                 6
454 #define Z_PrimitiveElement_intUnit             7
455 #define Z_PrimitiveElement_empty               8
456 #define Z_PrimitiveElement_noneOfTheAbove      100
457         Z_ElementInfoList *structured;
458     } u;
459 };
460
461 typedef struct Z_TagSetInfoElements
462 {
463     char *elementName;
464     int num_nicknames;
465     char **nicknames;                       /* OPTIONAL */
466     Z_StringOrNumeric *elementTag;
467     Z_HumanString *description;             /* OPTIONAL */
468     int *dataType;                          /* OPTIONAL */
469     /* (value as in Z_PrimitiveElement) */
470     Z_OtherInformation *otherTagInfo;       /* OPTIONAL */
471 } Z_TagSetInfoElements;
472
473 typedef struct Z_SchemaInfo
474 {
475     Z_CommonInfo *commonInfo;               /* OPTIONAL */
476     /*
477      * Key elements
478      */
479     Odr_oid *schema;
480     /*
481      * Non-key elements
482      */
483     char *name;
484     /*
485      * Non-brief elements
486      */
487     Z_HumanString *description;             /* OPTIONAL */
488     int num_tagTypeMapping;
489     Z_TagTypeMapping **tagTypeMapping;      /* OPTIONAL */
490     int num_recordStructure;
491     Z_ElementInfo **recordStructure;        /* OPTIONAL */
492 } Z_SchemaInfo;
493
494
495 typedef struct Z_TagSetInfo
496 {
497     Z_CommonInfo *commonInfo;               /* OPTIONAL */
498     /*
499      * Key elements
500      */
501     Odr_oid *tagSet;
502     /*
503      * Non-key elements
504      */
505     char *name;
506     /*
507      * Non-brief elements
508      */
509     Z_HumanString *description;             /* OPTIONAL */
510     int num_elements;
511     Z_TagSetInfoElements **elements;        /* OPTIONAL */
512 } Z_TagSetInfo;
513
514 typedef struct Z_RecordSyntaxInfo
515 {
516     Z_CommonInfo *commonInfo;               /* OPTIONAL */
517     /*
518      * Key elements
519      */
520     Odr_oid *recordSyntax;
521     /*
522      * Non-key elements
523      */
524     char *name;
525     /*
526      * Non-brief elements
527      */
528     int num_transferSyntaxes;
529     Odr_oid **transferSyntaxes;             /* OPTIONAL */
530     Z_HumanString *description;             /* OPTIONAL */
531     char *asn1Module;                       /* OPTIONAL */
532     int num_abstractStructure;
533     Z_ElementInfo **abstractStructure;      /* OPTIONAL */
534 } Z_RecordSyntaxInfo;
535
536 typedef struct Z_AttributeDescription
537 {
538     char *name;                             /* OPTIONAL */
539     Z_HumanString *description;             /* OPTIONAL */
540     Z_StringOrNumeric *attributeValue;
541     int num_equivalentAttributes;
542     Z_StringOrNumeric **equivalentAttributes; /* OPTIONAL */
543 } Z_AttributeDescription;
544
545 typedef struct Z_AttributeType
546 {
547     char *name;                             /* OPTIONAL */
548     Z_HumanString *description;             /* OPTIONAL */
549     int *attributeType;
550     int num_attributeValues;
551     Z_AttributeDescription **attributeValues;
552 } Z_AttributeType;
553
554 typedef struct Z_AttributeSetInfo
555 {
556     Z_CommonInfo *commonInfo;               /* OPTIONAL */
557     /*
558      * Key elements
559      */
560     Odr_oid *attributeSet;
561     /*
562      * Non-key elements
563      */
564     char *name;
565     /*
566      * Non-brief elements
567      */
568     int num_attributes;
569     Z_AttributeType **attributes;           /* OPTIONAL */
570     Z_HumanString *description;             /* OPTIONAL */
571 } Z_AttributeSetInfo;
572
573 typedef struct Z_TermListElement
574 {
575     char *name;
576     Z_HumanString *title;                   /* OPTIONAL */
577     int *searchCost;                        /* OPTIONAL */
578 #define Z_TermListInfo_optimized           0
579 #define Z_TermListInfo_normal              1
580 #define Z_TermListInfo_expensive           2
581 #define Z_TermListInfo_filter              3
582     bool_t *scanable;
583     int num_broader;
584     char **broader;                         /* OPTIONAL */
585     int num_narrower;
586     char **narrower;                        /* OPTIONAL */
587 } Z_TermListElement;
588
589 typedef struct Z_TermListInfo
590 {
591     Z_CommonInfo *commonInfo;               /* OPTIONAL */
592     /*
593      * Key elements
594      */
595     Z_DatabaseName *databaseName;
596     /*
597      * Non-key elements
598      */
599     int num_termLists;
600     Z_TermListElement **termLists;
601 } Z_TermListInfo;
602
603 typedef struct Z_ExtendedServicesInfo
604 {
605     Z_CommonInfo *commonInfo;               /* OPTIONAL */
606     /*
607      * Key elements
608      */
609     Odr_oid *type;
610     /*
611      * Non-key elements
612      */
613     char *name;                             /* OPTIONAL */
614     bool_t *privateType;
615     bool_t *restrictionsApply;
616     bool_t *feeApply;
617     bool_t *available;
618     bool_t *retentionSupported;
619     int *waitAction;
620 #define Z_ExtendedServicesInfo_waitSupported       1
621 #define Z_ExtendedServicesInfo_waitAlways          2
622 #define Z_ExtendedServicesInfo_waitNotSupported    3
623 #define Z_ExtendedServicesInfo_depends             4
624 #define Z_ExtendedServicesInfo_notSaying           5
625     /*
626      * Non-brief elements
627      */
628     Z_HumanString *description;             /* OPTIONAL */
629     Z_External *specificExplain;          /* OPTIONAL */
630     char *esASN;                            /* OPTIONAL */
631 } Z_ExtendedServicesInfo;
632
633 typedef struct Z_OmittedAttributeInterpretation
634 {
635     Z_StringOrNumeric *defaultValue;        /* OPTIONAL */
636     Z_HumanString *defaultDescription;      /* OPTIONAL */
637 } Z_OmittedAttributeInterpretation;
638
639 typedef struct Z_AttributeTypeDetails
640 {
641     int *attributeType;
642     Z_OmittedAttributeInterpretation *optionalType;  /* OPTIONAL */
643     int num_attributeValues;
644     Z_AttributeValue **attributeValues;     /* OPTIONAL */
645 } Z_AttributeTypeDetails;
646
647 typedef struct Z_AttributeSetDetails
648 {
649     Odr_oid *attributeSet;
650     int num_attributesByType;
651     Z_AttributeTypeDetails **attributesByType;
652 } Z_AttributeSetDetails;
653
654 typedef struct Z_AttributeDetails
655 {
656     Z_CommonInfo *commonInfo;               /* OPTIONAL */
657     /*
658      * Key details
659      */
660     Z_DatabaseName *databaseName;
661     /*
662      * Non-brief elements
663      */
664     int num_attributesBySet;
665     Z_AttributeSetDetails **attributesBySet;  /* OPTIONAL */
666     Z_AttributeCombinations *attributeCombinations;  /* OPTIONAL */
667 } Z_AttributeDetails;
668
669 typedef struct Z_EScanInfo
670 {
671     int *maxStepSize;                       /* OPTIONAL */
672     Z_HumanString *collatingSequence;       /* OPTIONAL */
673     bool_t *increasing;                     /* OPTIONAL */
674 } Z_EScanInfo;
675
676 typedef struct Z_TermListDetails
677 {
678     Z_CommonInfo *commonInfo;               /* OPTIONAL */
679     /*
680      * Key elements
681      */
682     char *termListName;
683     /*
684      * Non-brief elements
685      */
686     Z_HumanString *description;             /* OPTIONAL */
687     Z_AttributeCombinations *attributes;    /* OPTIONAL */
688     Z_EScanInfo *scanInfo;                  /* OPTIONAL */
689     int *estNumberTerms;                    /* OPTIONAL */
690     int num_sampleTerms;
691     Z_Term **sampleTerms;                   /* OPTIONAL */
692 } Z_TermListDetails;
693
694 typedef struct Z_RecordTag
695 {
696     Z_StringOrNumeric *qualifier;           /* OPTIONAL */
697     Z_StringOrNumeric *tagValue;
698 } Z_RecordTag;
699
700 typedef struct Z_PerElementDetails
701 {
702     char *name;                             /* OPTIONAL */
703     Z_RecordTag *recordTag;                 /* OPTIONAL */
704     int num_schemaTags;
705     Z_Path **schemaTags;                    /* OPTIONAL */
706     int *maxSize;                           /* OPTIONAL */
707     int *minSize;                           /* OPTIONAL */
708     int *avgSize;                           /* OPTIONAL */
709     int *fixedSize;                         /* OPTIONAL */
710     bool_t *repeatable;
711     bool_t *required;
712     Z_HumanString *description;             /* OPTIONAL */
713     Z_HumanString *contents;                /* OPTIONAL */
714     Z_HumanString *billingInfo;             /* OPTIONAL */
715     Z_HumanString *restrictions;            /* OPTIONAL */
716     int num_alternateNames;
717     char **alternateNames;                  /* OPTIONAL */
718     int num_genericNames;
719     char **genericNames;                    /* OPTIONAL */
720     Z_AttributeCombinations *searchAccess;  /* OPTIONAL */
721 } Z_PerElementDetails;
722
723 typedef struct Z_ElementSetDetails
724 {
725     Z_CommonInfo *commonInfo;               /* OPTIONAL */
726     /*
727      * Key elements
728      */
729     Z_DatabaseName *databaseName;
730     char *elementSetName;
731     Odr_oid *recordSyntax;
732     /*
733      * Brief elements
734      */
735     Odr_oid *schema;
736     /*
737      * Non-brief elements
738      */
739     Z_HumanString *description;             /* OPTIONAL */
740     int num_detailsPerElement;
741     Z_PerElementDetails **detailsPerElement;  /* OPTIONAL */
742 } Z_ElementSetDetails;
743
744 typedef struct Z_RetrievalRecordDetails
745 {
746     Z_CommonInfo *commonInfo;               /* OPTIONAL */
747     /*
748      * Key elements
749      */
750     Z_DatabaseName *databaseName;
751     Odr_oid *schema;
752     Odr_oid *recordSyntax;
753     /*
754      * Non-brief elements
755      */
756     Z_HumanString *description;             /* OPTIONAL */
757     int num_detailsPerElement;
758     Z_PerElementDetails **detailsPerElement;  /* OPTIONAL */
759 } Z_RetrievalRecordDetails;
760
761 typedef struct Z_SortKeyDetailsSortType
762 {
763     int which;
764 #define Z_SortKeyDetailsSortType_character 0
765 #define Z_SortKeyDetailsSortType_numeric 1
766 #define Z_SortKeyDetailsSortType_structured 2
767     union
768     {
769         Odr_null *character;
770         Odr_null *numeric;
771         Z_HumanString *structured;
772     } u;
773 } Z_SortKeyDetailsSortType;
774
775 typedef struct Z_SortKeyDetails
776 {
777     Z_HumanString *description;                        /* OPTIONAL */
778     int num_elementSpecifications;
779     Z_Specification **elementSpecifications;           /* OPTIONAL */
780     Z_AttributeCombinations *attributeSpecifications;  /* OPTIONAL */
781     Z_SortKeyDetailsSortType *sortType;                /* OPTIONAL */
782     int *caseSensitivity;                              /* OPTIONAL */
783 #define Z_SortKeyDetails_always              0
784 #define Z_SortKeyDetails_never               1
785 #define Z_SortKeyDetails_defaultYes          2
786 #define Z_SortKeyDetails_defaultNo           3
787 } Z_SortKeyDetails;
788
789 typedef struct Z_SortDetails
790 {
791     Z_CommonInfo *commonInfo;               /* OPTIONAL */
792     /*
793      * Key elements
794      */
795     Z_DatabaseName *databaseName;
796     /* 
797      * Non-brief elements
798      */
799     int num_sortKeys;
800     Z_SortKeyDetails **sortKeys;            /* OPTIONAL */
801 } Z_SortDetails;
802
803 typedef struct Z_ProcessingInformation
804 {
805     Z_CommonInfo *commonInfo;               /* OPTIONAL */
806     /*
807      * Key elements
808      */
809     Z_DatabaseName *databaseName;
810     int *processingContext;
811 #define Z_ProcessingInformation_access              0
812 #define Z_ProcessingInformation_search              1
813 #define Z_ProcessingInformation_retrieval           2
814 #define Z_ProcessingInformation_recordPresentation  3
815 #define Z_ProcessingInformation_recordHandling      4
816     char *name;
817     Odr_oid *oid;
818     /*
819      * Non-brief elements
820      */
821     Z_HumanString *description;             /* OPTIONAL */
822     Z_External *instructions;             /* OPTIONAL */
823 } Z_ProcessingInformation;
824
825 typedef struct Z_ValueDescription
826 {
827     int which;
828 #define Z_ValueDescription_integer 0
829 #define Z_ValueDescription_string 1
830 #define Z_ValueDescription_octets 2
831 #define Z_ValueDescription_oid 3
832 #define Z_ValueDescription_unit 4
833 #define Z_ValueDescription_valueAndUnit 5
834     union
835     {
836         int *integer;
837         char *string;
838         Odr_oct *octets;
839         Odr_oid *oid;
840         Z_Unit *unit;
841         Z_IntUnit *valueAndUnit;
842     } u;
843 } Z_ValueDescription;
844
845 typedef struct Z_ValueRange
846 {
847     Z_ValueDescription *lower;              /* OPTIONAL */
848     Z_ValueDescription *upper;              /* OPTIONAL */
849 } Z_ValueRange;
850
851 typedef struct Z_ValueSetEnumerated
852 {
853     int num_enumerated;
854     Z_ValueDescription **enumerated;
855 } Z_ValueSetEnumerated;
856
857 typedef struct Z_ValueSet
858 {
859     int which;
860 #define Z_ValueSet_range 0
861 #define Z_ValueSet_enumerated 1
862     union
863     {
864         Z_ValueRange *range;
865         Z_ValueSetEnumerated *enumerated;
866     } u;
867 } Z_ValueSet;
868
869 typedef struct Z_VariantValue
870 {
871     int *dataType;
872     Z_ValueSet *values;                     /* OPTIONAL */
873 } Z_VariantValue;
874
875 typedef struct Z_VariantType
876 {
877     char *name;                             /* OPTIONAL */
878     Z_HumanString *description;             /* OPTIONAL */
879     int *variantType;
880     Z_VariantValue *variantValue;           /* OPTIONAL */
881 } Z_VariantType;
882
883 typedef struct Z_VariantClass
884 {
885     char *name;                             /* OPTIONAL */
886     Z_HumanString *description;             /* OPTIONAL */
887     int *variantClass;
888     int num_variantTypes;
889     Z_VariantType **variantTypes;
890 } Z_VariantClass;
891
892 typedef struct Z_VariantSetInfo
893 {
894     Z_CommonInfo *commonInfo;               /* OPTIONAL */
895     /*
896      * Key elements
897      */
898     Odr_oid *variantSet;
899     /*
900      * Brief elements
901      */
902     char *name;
903     /*
904      * Non-brief elements
905      */
906     int num_variants;
907     Z_VariantClass **variants;              /* OPTIONAL */
908 } Z_VariantSetInfo;
909
910 typedef struct Z_Units
911 {
912     char *name;                             /* OPTIONAL */
913     Z_HumanString *description;             /* OPTIONAL */
914     Z_StringOrNumeric *unit;
915 } Z_Units;
916
917 typedef struct Z_UnitType
918 {
919     char *name;                             /* OPTIONAL */
920     Z_HumanString *description;             /* OPTIONAL */
921     Z_StringOrNumeric *unitType;
922     int num_units;
923     Z_Units **units;
924 } Z_UnitType;
925
926 typedef struct Z_UnitInfo
927 {
928     Z_CommonInfo *commonInfo;               /* OPTIONAL */
929     /*
930      * Key elements
931      */
932     char *unitSystem;
933     /*
934      * Non-brief elements
935      */
936     Z_HumanString *description;             /* OPTIONAL */
937     int num_units;
938     Z_UnitType **units;                     /* OPTIONAL */
939 } Z_UnitInfo;
940
941 typedef struct Z_CategoryInfo
942 {
943     char *category;
944     char *originalCategory;                 /* OPTIONAL */
945     Z_HumanString *description;             /* OPTIONAL */
946     char *asn1Module;                       /* OPTIONAL */
947 } Z_CategoryInfo;
948
949 typedef struct Z_CategoryList
950 {
951     Z_CommonInfo *commonInfo;               /* OPTIONAL */
952     int num_categories;
953     Z_CategoryInfo **categories;
954 } Z_CategoryList;
955
956 typedef struct Z_ExplainRecord
957 {
958     int which;
959 #define Z_Explain_targetInfo 0
960 #define Z_Explain_databaseInfo 1
961 #define Z_Explain_schemaInfo 2
962 #define Z_Explain_tagSetInfo 3
963 #define Z_Explain_recordSyntaxInfo 4
964 #define Z_Explain_attributeSetInfo 5
965 #define Z_Explain_termListInfo 6
966 #define Z_Explain_extendedServicesInfo 7
967 #define Z_Explain_attributeDetails 8
968 #define Z_Explain_termListDetails 9
969 #define Z_Explain_elementSetDetails 10
970 #define Z_Explain_retrievalRecordDetails 11
971 #define Z_Explain_sortDetails 12
972 #define Z_Explain_processing 13
973 #define Z_Explain_variants 14
974 #define Z_Explain_units 15
975 #define Z_Explain_categoryList 16
976     union
977     {
978         Z_TargetInfo *targetInfo;
979         Z_DatabaseInfo *databaseInfo;
980         Z_SchemaInfo *schemaInfo;
981         Z_TagSetInfo *tagSetInfo;
982         Z_RecordSyntaxInfo *recordSyntaxInfo;
983         Z_AttributeSetInfo *attributeSetInfo;
984         Z_TermListInfo *termListInfo;
985         Z_ExtendedServicesInfo *extendedServicesInfo;
986         Z_AttributeDetails *attributeDetails;
987         Z_TermListDetails *termListDetails;
988         Z_ElementSetDetails *elementSetDetails;
989         Z_RetrievalRecordDetails *retrievalRecordDetails;
990         Z_SortDetails *sortDetails;
991         Z_ProcessingInformation *processing;
992         Z_VariantSetInfo *variants;
993         Z_UnitInfo *units;
994         Z_CategoryList *categoryList;
995     } u;
996 } Z_ExplainRecord;
997
998 int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt);
999
1000 #endif