2 \brief ASN.1 Module ElementSpecificationFormat-eSpec-1
4 Generated automatically by YAZ ASN.1 Compiler 0.4
7 #include <yaz/z-espec1.h>
9 int z_Espec1 (ODR o, Z_Espec1 **p, int opt, const char *name)
11 if (!odr_sequence_begin (o, p, sizeof(**p), name))
12 return odr_missing(o, opt, name) && odr_ok (o);
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)) &&
29 int z_ElementRequestCompositeElementPrimitives (ODR o, Z_ElementRequestCompositeElementPrimitives **p, int opt, const char *name)
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,
36 if(o->direction == ODR_DECODE)
38 return odr_missing(o, opt, name);
41 int z_ElementRequestCompositeElementSpecs (ODR o, Z_ElementRequestCompositeElementSpecs **p, int opt, const char *name)
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,
48 if(o->direction == ODR_DECODE)
50 return odr_missing(o, opt, name);
53 int z_ElementRequestCompositeElement (ODR o, Z_ElementRequestCompositeElement **p, int opt, const char *name)
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}
62 if (!odr_sequence_begin (o, p, sizeof(**p), name))
63 return odr_missing(o, opt, name) && odr_ok (o);
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") &&
75 int z_ElementRequest (ODR o, Z_ElementRequest **p, int opt, const char *name)
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}
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))
88 if(o->direction == ODR_DECODE)
90 return odr_missing(o, opt, name);
93 int z_SimpleElement (ODR o, Z_SimpleElement **p, int opt, const char *name)
95 if (!odr_sequence_begin (o, p, sizeof(**p), name))
96 return odr_missing(o, opt, name) && odr_ok (o);
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);
105 int z_SpecificTag (ODR o, Z_SpecificTag **p, int opt, const char *name)
107 if (!odr_sequence_begin (o, p, sizeof(**p), name))
108 return odr_missing(o, opt, name) && odr_ok (o);
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);
119 int z_ETagUnit (ODR o, Z_ETagUnit **p, int opt, const char *name)
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}
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))
134 if(o->direction == ODR_DECODE)
136 return odr_missing(o, opt, name);
139 int z_ETagPath (ODR o, Z_ETagPath **p, int opt, const char *name)
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))
146 if(o->direction == ODR_DECODE)
148 return odr_missing(o, opt, name);
151 int z_OccurValues (ODR o, Z_OccurValues **p, int opt, const char *name)
153 if (!odr_sequence_begin (o, p, sizeof(**p), name))
154 return odr_missing(o, opt, name) && odr_ok (o);
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);
163 int z_Occurrences (ODR o, Z_Occurrences **p, int opt, const char *name)
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}
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))
178 if(o->direction == ODR_DECODE)
180 return odr_missing(o, opt, name);