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