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