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