Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
[yaz-moved-to-github.git] / include / prt-esp.h
1 /*
2  * Copyright (c) 1995, Index Data.
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and
5  * its documentation, in whole or in part, for any purpose, is hereby granted,
6  * provided that:
7  *
8  * 1. This copyright and permission notice appear in all copies of the
9  * software and its documentation. Notices of copyright or attribution
10  * which appear at the beginning of any file must remain unchanged.
11  *
12  * 2. The names of Index Data or the individual authors may not be used to
13  * endorse or promote products derived from this software without specific
14  * prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19  * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
21  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
22  * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24  * OF THIS SOFTWARE.
25  *
26  */
27
28 #ifndef PRT_ESP_H
29 #define PRT_ESP_H
30
31 #include <yconfig.h>
32
33 typedef struct Z_OccurValues
34 {
35     int *start;
36     int *howMany;                     /* OPTIONAL */
37 } Z_OccurValues;
38
39 typedef struct Z_Occurrences
40 {
41     int which;
42 #define Z_Occurrences_all 0
43 #define Z_Occurrences_last 1
44 #define Z_Occurrences_values 2
45     union
46     {
47         Odr_null *all;
48         Odr_null *last;
49         Z_OccurValues *values;
50     } u;
51 } Z_Occurrences;
52
53 typedef struct Z_SpecificTag
54 {
55     int *tagType;                           /* OPTIONAL */
56     Z_StringOrNumeric *tagValue;
57     Z_Occurrences *occurrences;             /* OPTIONAL */
58 } Z_SpecificTag;
59
60 typedef struct Z_ETagUnit
61 {
62     int which;
63 #define Z_ETagUnit_specificTag 0
64 #define Z_ETagUnit_wildThing 1
65 #define Z_ETagUnit_wildPath 2
66     union
67     {
68         Z_SpecificTag *specificTag;
69         Z_Occurrences *wildThing;
70         Odr_null *wildPath;
71     } u;
72 } Z_ETagUnit;
73
74 typedef struct Z_ETagPath
75 {
76     int num_tags;
77     Z_ETagUnit **tags;
78 } Z_ETagPath;
79
80 typedef struct Z_SimpleElement
81 {
82     Z_ETagPath *path;
83     Z_Variant *variantRequest;           /* OPTIONAL */
84 } Z_SimpleElement;
85
86 typedef struct Z_CompoPrimitives
87 {
88     int num_primitives;
89     char **primitives;
90 } Z_CompoPrimitives;
91
92 typedef struct Z_CompoSpecs
93 {
94     int num_specs;
95     Z_SimpleElement **specs;
96 } Z_CompoSpecs;
97
98 typedef struct Z_CompositeElement
99 {
100     int which;
101 #define Z_CompoElement_primitives 0
102 #define Z_CompoElement_specs 1
103     union
104     {
105         Z_CompoPrimitives *primitives;
106         Z_CompoSpecs *specs;
107     } elementList;
108     Z_ETagPath *deliveryTag;
109     Z_Variant *variantRequest;
110 } Z_CompositeElement;
111
112 typedef struct Z_ElementRequest
113 {
114     int which;
115 #define Z_ERequest_simpleElement 0
116 #define Z_ERequest_compositeElement 1
117     union
118     {
119         Z_SimpleElement *simpleElement;
120         Z_CompositeElement *compositeElement;
121     } u;
122 } Z_ElementRequest;
123
124 typedef struct Z_Espec1
125 {
126     int num_elementSetNames;
127     char **elementSetNames;               /* OPTIONAL */
128     Odr_oid *defaultVariantSetId;         /* OPTIONAL */
129     Z_Variant *defaultVariantRequest;     /* OPTIONAL */
130     int *defaultTagType;                  /* OPTIONAL */
131     int num_elements;
132     Z_ElementRequest **elements;           /* OPTIONAL */
133 } Z_Espec1;
134
135 int z_Espec1(ODR o, Z_Espec1 **p, int opt);
136
137 #endif