Initial commit
[yaz4j-moved-to-github.git] / dependencies / yaz-2.1.28 / src / z-espec1.c
1 /** \file z-espec1.c
2     \brief ASN.1 Module ElementSpecificationFormat-eSpec-1
3
4     Generated automatically by YAZ ASN.1 Compiler 0.4
5 */
6
7 #include <yaz/z-espec1.h>
8
9 int z_Espec1 (ODR o, Z_Espec1 **p, int opt, const char *name)
10 {
11         if (!odr_sequence_begin (o, p, sizeof(**p), name))
12                 return odr_missing(o, opt, name) && odr_ok (o);
13         return
14                 odr_implicit_settag (o, ODR_CONTEXT, 1) &&
15                 (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->elementSetNames,
16                   &(*p)->num_elementSetNames, "elementSetNames") || odr_ok(o)) &&
17                 odr_implicit_tag (o, odr_oid,
18                         &(*p)->defaultVariantSetId, ODR_CONTEXT, 2, 1, "defaultVariantSetId") &&
19                 odr_implicit_tag (o, z_Variant,
20                         &(*p)->defaultVariantRequest, ODR_CONTEXT, 3, 1, "defaultVariantRequest") &&
21                 odr_implicit_tag (o, odr_integer,
22                         &(*p)->defaultTagType, ODR_CONTEXT, 4, 1, "defaultTagType") &&
23                 odr_implicit_settag (o, ODR_CONTEXT, 5) &&
24                 (odr_sequence_of(o, (Odr_fun) z_ElementRequest, &(*p)->elements,
25                   &(*p)->num_elements, "elements") || odr_ok(o)) &&
26                 odr_sequence_end (o);
27 }
28
29 int z_ElementRequestCompositeElementPrimitives (ODR o, Z_ElementRequestCompositeElementPrimitives **p, int opt, const char *name)
30 {
31         if (!odr_initmember (o, p, sizeof(**p)))
32                 return odr_missing(o, opt, name);
33         if (odr_sequence_of (o, (Odr_fun) z_InternationalString, &(*p)->elements,
34                 &(*p)->num, name))
35                 return 1;
36         if(o->direction == ODR_DECODE)
37                 *p = 0;
38         return odr_missing(o, opt, name);
39 }
40
41 int z_ElementRequestCompositeElementSpecs (ODR o, Z_ElementRequestCompositeElementSpecs **p, int opt, const char *name)
42 {
43         if (!odr_initmember (o, p, sizeof(**p)))
44                 return odr_missing(o, opt, name);
45         if (odr_sequence_of (o, (Odr_fun) z_SimpleElement, &(*p)->elements,
46                 &(*p)->num, name))
47                 return 1;
48         if(o->direction == ODR_DECODE)
49                 *p = 0;
50         return odr_missing(o, opt, name);
51 }
52
53 int z_ElementRequestCompositeElement (ODR o, Z_ElementRequestCompositeElement **p, int opt, const char *name)
54 {
55         static Odr_arm arm[] = {
56                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementRequestCompositeElement_primitives,
57                 (Odr_fun) z_ElementRequestCompositeElementPrimitives, "primitives"},
58                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementRequestCompositeElement_specs,
59                 (Odr_fun) z_ElementRequestCompositeElementSpecs, "specs"},
60                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
61         };
62         if (!odr_sequence_begin (o, p, sizeof(**p), name))
63                 return odr_missing(o, opt, name) && odr_ok (o);
64         return
65                 odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, "elementList") &&
66                 odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) &&
67                 odr_constructed_end (o) &&
68                 odr_implicit_tag (o, z_ETagPath,
69                         &(*p)->deliveryTag, ODR_CONTEXT, 2, 0, "deliveryTag") &&
70                 odr_implicit_tag (o, z_Variant,
71                         &(*p)->variantRequest, ODR_CONTEXT, 3, 1, "variantRequest") &&
72                 odr_sequence_end (o);
73 }
74
75 int z_ElementRequest (ODR o, Z_ElementRequest **p, int opt, const char *name)
76 {
77         static Odr_arm arm[] = {
78                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ERequest_simpleElement,
79                 (Odr_fun) z_SimpleElement, "simpleElement"},
80                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ERequest_compositeElement,
81                 (Odr_fun) z_ElementRequestCompositeElement, "compositeElement"},
82                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
83         };
84         if (!odr_initmember(o, p, sizeof(**p)))
85                 return odr_missing(o, opt, name);
86         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
87                 return 1;
88         if(o->direction == ODR_DECODE)
89                 *p = 0;
90         return odr_missing(o, opt, name);
91 }
92
93 int z_SimpleElement (ODR o, Z_SimpleElement **p, int opt, const char *name)
94 {
95         if (!odr_sequence_begin (o, p, sizeof(**p), name))
96                 return odr_missing(o, opt, name) && odr_ok (o);
97         return
98                 odr_implicit_tag (o, z_ETagPath,
99                         &(*p)->path, ODR_CONTEXT, 1, 0, "path") &&
100                 odr_implicit_tag (o, z_Variant,
101                         &(*p)->variantRequest, ODR_CONTEXT, 2, 1, "variantRequest") &&
102                 odr_sequence_end (o);
103 }
104
105 int z_SpecificTag (ODR o, Z_SpecificTag **p, int opt, const char *name)
106 {
107         if (!odr_sequence_begin (o, p, sizeof(**p), name))
108                 return odr_missing(o, opt, name) && odr_ok (o);
109         return
110                 odr_implicit_tag (o, odr_integer,
111                         &(*p)->tagType, ODR_CONTEXT, 1, 1, "tagType") &&
112                 odr_explicit_tag (o, z_StringOrNumeric,
113                         &(*p)->tagValue, ODR_CONTEXT, 2, 0, "tagValue") &&
114                 odr_explicit_tag (o, z_Occurrences,
115                         &(*p)->occurrences, ODR_CONTEXT, 3, 1, "occurrences") &&
116                 odr_sequence_end (o);
117 }
118
119 int z_ETagUnit (ODR o, Z_ETagUnit **p, int opt, const char *name)
120 {
121         static Odr_arm arm[] = {
122                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ETagUnit_specificTag,
123                 (Odr_fun) z_SpecificTag, "specificTag"},
124                 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_ETagUnit_wildThing,
125                 (Odr_fun) z_Occurrences, "wildThing"},
126                 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ETagUnit_wildPath,
127                 (Odr_fun) odr_null, "wildPath"},
128                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
129         };
130         if (!odr_initmember(o, p, sizeof(**p)))
131                 return odr_missing(o, opt, name);
132         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
133                 return 1;
134         if(o->direction == ODR_DECODE)
135                 *p = 0;
136         return odr_missing(o, opt, name);
137 }
138
139 int z_ETagPath (ODR o, Z_ETagPath **p, int opt, const char *name)
140 {
141         if (!odr_initmember (o, p, sizeof(**p)))
142                 return odr_missing(o, opt, name);
143         if (odr_sequence_of (o, (Odr_fun) z_ETagUnit, &(*p)->tags,
144                 &(*p)->num_tags, name))
145                 return 1;
146         if(o->direction == ODR_DECODE)
147                 *p = 0;
148         return odr_missing(o, opt, name);
149 }
150
151 int z_OccurValues (ODR o, Z_OccurValues **p, int opt, const char *name)
152 {
153         if (!odr_sequence_begin (o, p, sizeof(**p), name))
154                 return odr_missing(o, opt, name) && odr_ok (o);
155         return
156                 odr_implicit_tag (o, odr_integer,
157                         &(*p)->start, ODR_CONTEXT, 1, 0, "start") &&
158                 odr_implicit_tag (o, odr_integer,
159                         &(*p)->howMany, ODR_CONTEXT, 2, 1, "howMany") &&
160                 odr_sequence_end (o);
161 }
162
163 int z_Occurrences (ODR o, Z_Occurrences **p, int opt, const char *name)
164 {
165         static Odr_arm arm[] = {
166                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Occurrences_all,
167                 (Odr_fun) odr_null, "all"},
168                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Occurrences_last,
169                 (Odr_fun) odr_null, "last"},
170                 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Occurrences_values,
171                 (Odr_fun) z_OccurValues, "values"},
172                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
173         };
174         if (!odr_initmember(o, p, sizeof(**p)))
175                 return odr_missing(o, opt, name);
176         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
177                 return 1;
178         if(o->direction == ODR_DECODE)
179                 *p = 0;
180         return odr_missing(o, opt, name);
181 }