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