1 /** \file z-exp.c
2     \brief ASN.1 Module RecordSyntax-explain
3 
4     Generated automatically by YAZ ASN.1 Compiler 0.4
5 */
6 #if HAVE_CONFIG_H
7 #include <config.h>
8 #endif
9 
10 #include <yaz/z-exp.h>
11 
z_ExplainRecord(ODR o,Z_ExplainRecord ** p,int opt,const char * name)12 int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt, const char *name)
13 {
14 	static Odr_arm arm[] = {
15 		{ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Explain_targetInfo,
16 		(Odr_fun) z_TargetInfo, "targetInfo"},
17 		{ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Explain_databaseInfo,
18 		(Odr_fun) z_DatabaseInfo, "databaseInfo"},
19 		{ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Explain_schemaInfo,
20 		(Odr_fun) z_SchemaInfo, "schemaInfo"},
21 		{ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Explain_tagSetInfo,
22 		(Odr_fun) z_TagSetInfo, "tagSetInfo"},
23 		{ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Explain_recordSyntaxInfo,
24 		(Odr_fun) z_RecordSyntaxInfo, "recordSyntaxInfo"},
25 		{ODR_IMPLICIT, ODR_CONTEXT, 5, Z_Explain_attributeSetInfo,
26 		(Odr_fun) z_AttributeSetInfo, "attributeSetInfo"},
27 		{ODR_IMPLICIT, ODR_CONTEXT, 6, Z_Explain_termListInfo,
28 		(Odr_fun) z_TermListInfo, "termListInfo"},
29 		{ODR_IMPLICIT, ODR_CONTEXT, 7, Z_Explain_extendedServicesInfo,
30 		(Odr_fun) z_ExtendedServicesInfo, "extendedServicesInfo"},
31 		{ODR_IMPLICIT, ODR_CONTEXT, 8, Z_Explain_attributeDetails,
32 		(Odr_fun) z_AttributeDetails, "attributeDetails"},
33 		{ODR_IMPLICIT, ODR_CONTEXT, 9, Z_Explain_termListDetails,
34 		(Odr_fun) z_TermListDetails, "termListDetails"},
35 		{ODR_IMPLICIT, ODR_CONTEXT, 10, Z_Explain_elementSetDetails,
36 		(Odr_fun) z_ElementSetDetails, "elementSetDetails"},
37 		{ODR_IMPLICIT, ODR_CONTEXT, 11, Z_Explain_retrievalRecordDetails,
38 		(Odr_fun) z_RetrievalRecordDetails, "retrievalRecordDetails"},
39 		{ODR_IMPLICIT, ODR_CONTEXT, 12, Z_Explain_sortDetails,
40 		(Odr_fun) z_SortDetails, "sortDetails"},
41 		{ODR_IMPLICIT, ODR_CONTEXT, 13, Z_Explain_processing,
42 		(Odr_fun) z_ProcessingInformation, "processing"},
43 		{ODR_IMPLICIT, ODR_CONTEXT, 14, Z_Explain_variants,
44 		(Odr_fun) z_VariantSetInfo, "variants"},
45 		{ODR_IMPLICIT, ODR_CONTEXT, 15, Z_Explain_units,
46 		(Odr_fun) z_UnitInfo, "units"},
47 		{ODR_IMPLICIT, ODR_CONTEXT, 100, Z_Explain_categoryList,
48 		(Odr_fun) z_CategoryList, "categoryList"},
49 		{-1, -1, -1, -1, (Odr_fun) 0, 0}
50 	};
51 	if (!odr_initmember(o, p, sizeof(**p)))
52 		return odr_missing(o, opt, name);
53 	if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
54 		return 1;
55 	if (o->direction == ODR_DECODE)
56 		*p = 0;
57 	return odr_missing(o, opt, name);
58 }
59 
z_TargetInfo(ODR o,Z_TargetInfo ** p,int opt,const char * name)60 int z_TargetInfo(ODR o, Z_TargetInfo **p, int opt, const char *name)
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_implicit_tag(o, z_CommonInfo,
66 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
67 		odr_implicit_tag(o, z_InternationalString,
68 			&(*p)->name, ODR_CONTEXT, 1, 0, "name") &&
69 		odr_implicit_tag(o, z_HumanString,
70 			&(*p)->recentNews, ODR_CONTEXT, 2, 1, "recentNews") &&
71 		odr_implicit_tag(o, z_IconObject,
72 			&(*p)->icon, ODR_CONTEXT, 3, 1, "icon") &&
73 		odr_implicit_tag(o, odr_bool,
74 			&(*p)->namedResultSets, ODR_CONTEXT, 4, 0, "namedResultSets") &&
75 		odr_implicit_tag(o, odr_bool,
76 			&(*p)->multipleDBsearch, ODR_CONTEXT, 5, 0, "multipleDBsearch") &&
77 		odr_implicit_tag(o, odr_integer,
78 			&(*p)->maxResultSets, ODR_CONTEXT, 6, 1, "maxResultSets") &&
79 		odr_implicit_tag(o, odr_integer,
80 			&(*p)->maxResultSize, ODR_CONTEXT, 7, 1, "maxResultSize") &&
81 		odr_implicit_tag(o, odr_integer,
82 			&(*p)->maxTerms, ODR_CONTEXT, 8, 1, "maxTerms") &&
83 		odr_implicit_tag(o, z_IntUnit,
84 			&(*p)->timeoutInterval, ODR_CONTEXT, 9, 1, "timeoutInterval") &&
85 		odr_implicit_tag(o, z_HumanString,
86 			&(*p)->welcomeMessage, ODR_CONTEXT, 10, 1, "welcomeMessage") &&
87 		odr_implicit_tag(o, z_ContactInfo,
88 			&(*p)->contactInfo, ODR_CONTEXT, 11, 1, "contactInfo") &&
89 		odr_implicit_tag(o, z_HumanString,
90 			&(*p)->description, ODR_CONTEXT, 12, 1, "description") &&
91 		odr_implicit_settag(o, ODR_CONTEXT, 13) &&
92 		(odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->nicknames,
93 		  &(*p)->num_nicknames, "nicknames") || odr_ok(o)) &&
94 		odr_implicit_tag(o, z_HumanString,
95 			&(*p)->usageRest, ODR_CONTEXT, 14, 1, "usageRest") &&
96 		odr_implicit_tag(o, z_HumanString,
97 			&(*p)->paymentAddr, ODR_CONTEXT, 15, 1, "paymentAddr") &&
98 		odr_implicit_tag(o, z_HumanString,
99 			&(*p)->hours, ODR_CONTEXT, 16, 1, "hours") &&
100 		odr_implicit_settag(o, ODR_CONTEXT, 17) &&
101 		(odr_sequence_of(o, (Odr_fun) z_DatabaseList, &(*p)->dbCombinations,
102 		  &(*p)->num_dbCombinations, "dbCombinations") || odr_ok(o)) &&
103 		odr_implicit_settag(o, ODR_CONTEXT, 18) &&
104 		(odr_sequence_of(o, (Odr_fun) z_NetworkAddress, &(*p)->addresses,
105 		  &(*p)->num_addresses, "addresses") || odr_ok(o)) &&
106 		odr_implicit_settag(o, ODR_CONTEXT, 101) &&
107 		(odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->languages,
108 		  &(*p)->num_languages, "languages") || odr_ok(o)) &&
109 		odr_implicit_tag(o, z_AccessInfo,
110 			&(*p)->commonAccessInfo, ODR_CONTEXT, 19, 1, "commonAccessInfo") &&
111 		odr_sequence_end(o);
112 }
113 
z_DatabaseInfo(ODR o,Z_DatabaseInfo ** p,int opt,const char * name)114 int z_DatabaseInfo(ODR o, Z_DatabaseInfo **p, int opt, const char *name)
115 {
116 	static Odr_arm arm[] = {
117 		{ODR_IMPLICIT, ODR_CONTEXT, 0, Z_DatabaseInfo_actualNumber,
118 		(Odr_fun) odr_integer, "actualNumber"},
119 		{ODR_IMPLICIT, ODR_CONTEXT, 1, Z_DatabaseInfo_approxNumber,
120 		(Odr_fun) odr_integer, "approxNumber"},
121 		{-1, -1, -1, -1, (Odr_fun) 0, 0}
122 	};
123 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
124 		return odr_missing(o, opt, name) && odr_ok (o);
125 	return
126 		odr_implicit_tag(o, z_CommonInfo,
127 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
128 		odr_implicit_tag(o, z_DatabaseName,
129 			&(*p)->name, ODR_CONTEXT, 1, 0, "name") &&
130 		odr_implicit_tag(o, odr_null,
131 			&(*p)->explainDatabase, ODR_CONTEXT, 2, 1, "explainDatabase") &&
132 		odr_implicit_settag(o, ODR_CONTEXT, 3) &&
133 		(odr_sequence_of(o, (Odr_fun) z_DatabaseName, &(*p)->nicknames,
134 		  &(*p)->num_nicknames, "nicknames") || odr_ok(o)) &&
135 		odr_implicit_tag(o, z_IconObject,
136 			&(*p)->icon, ODR_CONTEXT, 4, 1, "icon") &&
137 		odr_implicit_tag(o, odr_bool,
138 			&(*p)->userFee, ODR_CONTEXT, 5, 0, "userFee") &&
139 		odr_implicit_tag(o, odr_bool,
140 			&(*p)->available, ODR_CONTEXT, 6, 0, "available") &&
141 		odr_implicit_tag(o, z_HumanString,
142 			&(*p)->titleString, ODR_CONTEXT, 7, 1, "titleString") &&
143 		odr_implicit_settag(o, ODR_CONTEXT, 8) &&
144 		(odr_sequence_of(o, (Odr_fun) z_HumanString, &(*p)->keywords,
145 		  &(*p)->num_keywords, "keywords") || odr_ok(o)) &&
146 		odr_implicit_tag(o, z_HumanString,
147 			&(*p)->description, ODR_CONTEXT, 9, 1, "description") &&
148 		odr_implicit_tag(o, z_DatabaseList,
149 			&(*p)->associatedDbs, ODR_CONTEXT, 10, 1, "associatedDbs") &&
150 		odr_implicit_tag(o, z_DatabaseList,
151 			&(*p)->subDbs, ODR_CONTEXT, 11, 1, "subDbs") &&
152 		odr_implicit_tag(o, z_HumanString,
153 			&(*p)->disclaimers, ODR_CONTEXT, 12, 1, "disclaimers") &&
154 		odr_implicit_tag(o, z_HumanString,
155 			&(*p)->news, ODR_CONTEXT, 13, 1, "news") &&
156 		((odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 14, "recordCount") &&
157 		odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
158 		odr_constructed_end(o)) || odr_ok(o)) &&
159 		odr_implicit_tag(o, z_HumanString,
160 			&(*p)->defaultOrder, ODR_CONTEXT, 15, 1, "defaultOrder") &&
161 		odr_implicit_tag(o, odr_integer,
162 			&(*p)->avRecordSize, ODR_CONTEXT, 16, 1, "avRecordSize") &&
163 		odr_implicit_tag(o, odr_integer,
164 			&(*p)->maxRecordSize, ODR_CONTEXT, 17, 1, "maxRecordSize") &&
165 		odr_implicit_tag(o, z_HumanString,
166 			&(*p)->hours, ODR_CONTEXT, 18, 1, "hours") &&
167 		odr_implicit_tag(o, z_HumanString,
168 			&(*p)->bestTime, ODR_CONTEXT, 19, 1, "bestTime") &&
169 		odr_implicit_tag(o, odr_generalizedtime,
170 			&(*p)->lastUpdate, ODR_CONTEXT, 20, 1, "lastUpdate") &&
171 		odr_implicit_tag(o, z_IntUnit,
172 			&(*p)->updateInterval, ODR_CONTEXT, 21, 1, "updateInterval") &&
173 		odr_implicit_tag(o, z_HumanString,
174 			&(*p)->coverage, ODR_CONTEXT, 22, 1, "coverage") &&
175 		odr_implicit_tag(o, odr_bool,
176 			&(*p)->proprietary, ODR_CONTEXT, 23, 1, "proprietary") &&
177 		odr_implicit_tag(o, z_HumanString,
178 			&(*p)->copyrightText, ODR_CONTEXT, 24, 1, "copyrightText") &&
179 		odr_implicit_tag(o, z_HumanString,
180 			&(*p)->copyrightNotice, ODR_CONTEXT, 25, 1, "copyrightNotice") &&
181 		odr_implicit_tag(o, z_ContactInfo,
182 			&(*p)->producerContactInfo, ODR_CONTEXT, 26, 1, "producerContactInfo") &&
183 		odr_implicit_tag(o, z_ContactInfo,
184 			&(*p)->supplierContactInfo, ODR_CONTEXT, 27, 1, "supplierContactInfo") &&
185 		odr_implicit_tag(o, z_ContactInfo,
186 			&(*p)->submissionContactInfo, ODR_CONTEXT, 28, 1, "submissionContactInfo") &&
187 		odr_implicit_tag(o, z_AccessInfo,
188 			&(*p)->accessInfo, ODR_CONTEXT, 29, 1, "accessInfo") &&
189 		odr_sequence_end(o);
190 }
191 
z_TagTypeMapping(ODR o,Z_TagTypeMapping ** p,int opt,const char * name)192 int z_TagTypeMapping(ODR o, Z_TagTypeMapping **p, int opt, const char *name)
193 {
194 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
195 		return odr_missing(o, opt, name) && odr_ok (o);
196 	return
197 		odr_implicit_tag(o, odr_integer,
198 			&(*p)->tagType, ODR_CONTEXT, 0, 0, "tagType") &&
199 		odr_implicit_tag(o, odr_oid,
200 			&(*p)->tagSet, ODR_CONTEXT, 1, 1, "tagSet") &&
201 		odr_implicit_tag(o, odr_null,
202 			&(*p)->defaultTagType, ODR_CONTEXT, 2, 1, "defaultTagType") &&
203 		odr_sequence_end(o);
204 }
205 
z_SchemaInfo(ODR o,Z_SchemaInfo ** p,int opt,const char * name)206 int z_SchemaInfo(ODR o, Z_SchemaInfo **p, int opt, const char *name)
207 {
208 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
209 		return odr_missing(o, opt, name) && odr_ok (o);
210 	return
211 		odr_implicit_tag(o, z_CommonInfo,
212 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
213 		odr_implicit_tag(o, odr_oid,
214 			&(*p)->schema, ODR_CONTEXT, 1, 0, "schema") &&
215 		odr_implicit_tag(o, z_InternationalString,
216 			&(*p)->name, ODR_CONTEXT, 2, 0, "name") &&
217 		odr_implicit_tag(o, z_HumanString,
218 			&(*p)->description, ODR_CONTEXT, 3, 1, "description") &&
219 		odr_implicit_settag(o, ODR_CONTEXT, 4) &&
220 		(odr_sequence_of(o, (Odr_fun) z_TagTypeMapping, &(*p)->tagTypeMapping,
221 		  &(*p)->num_tagTypeMapping, "tagTypeMapping") || odr_ok(o)) &&
222 		odr_implicit_settag(o, ODR_CONTEXT, 5) &&
223 		(odr_sequence_of(o, (Odr_fun) z_ElementInfo, &(*p)->recordStructure,
224 		  &(*p)->num_recordStructure, "recordStructure") || odr_ok(o)) &&
225 		odr_sequence_end(o);
226 }
227 
z_ElementInfo(ODR o,Z_ElementInfo ** p,int opt,const char * name)228 int z_ElementInfo(ODR o, Z_ElementInfo **p, int opt, const char *name)
229 {
230 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
231 		return odr_missing(o, opt, name) && odr_ok (o);
232 	return
233 		odr_implicit_tag(o, z_InternationalString,
234 			&(*p)->elementName, ODR_CONTEXT, 1, 0, "elementName") &&
235 		odr_implicit_tag(o, z_Path,
236 			&(*p)->elementTagPath, ODR_CONTEXT, 2, 0, "elementTagPath") &&
237 		odr_explicit_tag(o, z_ElementDataType,
238 			&(*p)->dataType, ODR_CONTEXT, 3, 1, "dataType") &&
239 		odr_implicit_tag(o, odr_bool,
240 			&(*p)->required, ODR_CONTEXT, 4, 0, "required") &&
241 		odr_implicit_tag(o, odr_bool,
242 			&(*p)->repeatable, ODR_CONTEXT, 5, 0, "repeatable") &&
243 		odr_implicit_tag(o, z_HumanString,
244 			&(*p)->description, ODR_CONTEXT, 6, 1, "description") &&
245 		odr_sequence_end(o);
246 }
247 
z_PathUnit(ODR o,Z_PathUnit ** p,int opt,const char * name)248 int z_PathUnit(ODR o, Z_PathUnit **p, int opt, const char *name)
249 {
250 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
251 		return odr_missing(o, opt, name) && odr_ok (o);
252 	return
253 		odr_implicit_tag(o, odr_integer,
254 			&(*p)->tagType, ODR_CONTEXT, 1, 0, "tagType") &&
255 		odr_explicit_tag(o, z_StringOrNumeric,
256 			&(*p)->tagValue, ODR_CONTEXT, 2, 0, "tagValue") &&
257 		odr_sequence_end(o);
258 }
259 
z_Path(ODR o,Z_Path ** p,int opt,const char * name)260 int z_Path(ODR o, Z_Path **p, int opt, const char *name)
261 {
262 	if (!odr_initmember(o, p, sizeof(**p)))
263 		return odr_missing(o, opt, name);
264 	if (odr_sequence_of(o, (Odr_fun) z_PathUnit, &(*p)->elements,
265 		&(*p)->num, name))
266 		return 1;
267 	if (o->direction == ODR_DECODE)
268 		*p = 0;
269 	return odr_missing(o, opt, name);
270 }
271 
z_ElementInfoList(ODR o,Z_ElementInfoList ** p,int opt,const char * name)272 int z_ElementInfoList(ODR o, Z_ElementInfoList **p, int opt, const char *name)
273 {
274 	if (!odr_initmember(o, p, sizeof(**p)))
275 		return odr_missing(o, opt, name);
276 	if (odr_sequence_of(o, (Odr_fun) z_ElementInfo, &(*p)->elements,
277 		&(*p)->num, name))
278 		return 1;
279 	if (o->direction == ODR_DECODE)
280 		*p = 0;
281 	return odr_missing(o, opt, name);
282 }
283 
z_ElementDataType(ODR o,Z_ElementDataType ** p,int opt,const char * name)284 int z_ElementDataType(ODR o, Z_ElementDataType **p, int opt, const char *name)
285 {
286 	static Odr_arm arm[] = {
287 		{ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ElementDataType_primitive,
288 		(Odr_fun) z_PrimitiveDataType, "primitive"},
289 		{ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementDataType_structured,
290 		(Odr_fun) z_ElementInfoList, "structured"},
291 		{-1, -1, -1, -1, (Odr_fun) 0, 0}
292 	};
293 	if (!odr_initmember(o, p, sizeof(**p)))
294 		return odr_missing(o, opt, name);
295 	if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
296 		return 1;
297 	if (o->direction == ODR_DECODE)
298 		*p = 0;
299 	return odr_missing(o, opt, name);
300 }
301 
z_PrimitiveDataType(ODR o,Z_PrimitiveDataType ** p,int opt,const char * name)302 int z_PrimitiveDataType(ODR o, Z_PrimitiveDataType **p, int opt, const char *name)
303 {
304 	return odr_integer (o, p, opt, name);
305 }
306 
z_TagSetElements(ODR o,Z_TagSetElements ** p,int opt,const char * name)307 int z_TagSetElements(ODR o, Z_TagSetElements **p, int opt, const char *name)
308 {
309 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
310 		return odr_missing(o, opt, name) && odr_ok (o);
311 	return
312 		odr_implicit_tag(o, z_InternationalString,
313 			&(*p)->elementname, ODR_CONTEXT, 1, 0, "elementname") &&
314 		odr_implicit_settag(o, ODR_CONTEXT, 2) &&
315 		(odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->nicknames,
316 		  &(*p)->num_nicknames, "nicknames") || odr_ok(o)) &&
317 		odr_explicit_tag(o, z_StringOrNumeric,
318 			&(*p)->elementTag, ODR_CONTEXT, 3, 0, "elementTag") &&
319 		odr_implicit_tag(o, z_HumanString,
320 			&(*p)->description, ODR_CONTEXT, 4, 1, "description") &&
321 		odr_explicit_tag(o, z_PrimitiveDataType,
322 			&(*p)->dataType, ODR_CONTEXT, 5, 1, "dataType") &&
323 		z_OtherInformation(o, &(*p)->otherTagInfo, 1, "otherTagInfo") &&
324 		odr_sequence_end(o);
325 }
326 
z_TagSetInfo(ODR o,Z_TagSetInfo ** p,int opt,const char * name)327 int z_TagSetInfo(ODR o, Z_TagSetInfo **p, int opt, const char *name)
328 {
329 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
330 		return odr_missing(o, opt, name) && odr_ok (o);
331 	return
332 		odr_implicit_tag(o, z_CommonInfo,
333 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
334 		odr_implicit_tag(o, odr_oid,
335 			&(*p)->tagSet, ODR_CONTEXT, 1, 0, "tagSet") &&
336 		odr_implicit_tag(o, z_InternationalString,
337 			&(*p)->name, ODR_CONTEXT, 2, 0, "name") &&
338 		odr_implicit_tag(o, z_HumanString,
339 			&(*p)->description, ODR_CONTEXT, 3, 1, "description") &&
340 		odr_implicit_settag(o, ODR_CONTEXT, 4) &&
341 		(odr_sequence_of(o, (Odr_fun) z_TagSetElements, &(*p)->elements,
342 		  &(*p)->num_elements, "elements") || odr_ok(o)) &&
343 		odr_sequence_end(o);
344 }
345 
z_RecordSyntaxInfo(ODR o,Z_RecordSyntaxInfo ** p,int opt,const char * name)346 int z_RecordSyntaxInfo(ODR o, Z_RecordSyntaxInfo **p, int opt, const char *name)
347 {
348 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
349 		return odr_missing(o, opt, name) && odr_ok (o);
350 	return
351 		odr_implicit_tag(o, z_CommonInfo,
352 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
353 		odr_implicit_tag(o, odr_oid,
354 			&(*p)->recordSyntax, ODR_CONTEXT, 1, 0, "recordSyntax") &&
355 		odr_implicit_tag(o, z_InternationalString,
356 			&(*p)->name, ODR_CONTEXT, 2, 0, "name") &&
357 		odr_implicit_settag(o, ODR_CONTEXT, 3) &&
358 		(odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->transferSyntaxes,
359 		  &(*p)->num_transferSyntaxes, "transferSyntaxes") || odr_ok(o)) &&
360 		odr_implicit_tag(o, z_HumanString,
361 			&(*p)->description, ODR_CONTEXT, 4, 1, "description") &&
362 		odr_implicit_tag(o, z_InternationalString,
363 			&(*p)->asn1Module, ODR_CONTEXT, 5, 1, "asn1Module") &&
364 		odr_implicit_settag(o, ODR_CONTEXT, 6) &&
365 		(odr_sequence_of(o, (Odr_fun) z_ElementInfo, &(*p)->abstractStructure,
366 		  &(*p)->num_abstractStructure, "abstractStructure") || odr_ok(o)) &&
367 		odr_sequence_end(o);
368 }
369 
z_AttributeSetInfo(ODR o,Z_AttributeSetInfo ** p,int opt,const char * name)370 int z_AttributeSetInfo(ODR o, Z_AttributeSetInfo **p, int opt, const char *name)
371 {
372 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
373 		return odr_missing(o, opt, name) && odr_ok (o);
374 	return
375 		odr_implicit_tag(o, z_CommonInfo,
376 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
377 		odr_implicit_tag(o, z_AttributeSetId,
378 			&(*p)->attributeSet, ODR_CONTEXT, 1, 0, "attributeSet") &&
379 		odr_implicit_tag(o, z_InternationalString,
380 			&(*p)->name, ODR_CONTEXT, 2, 0, "name") &&
381 		odr_implicit_settag(o, ODR_CONTEXT, 3) &&
382 		(odr_sequence_of(o, (Odr_fun) z_AttributeType, &(*p)->attributes,
383 		  &(*p)->num_attributes, "attributes") || odr_ok(o)) &&
384 		odr_implicit_tag(o, z_HumanString,
385 			&(*p)->description, ODR_CONTEXT, 4, 1, "description") &&
386 		odr_sequence_end(o);
387 }
388 
z_AttributeType(ODR o,Z_AttributeType ** p,int opt,const char * name)389 int z_AttributeType(ODR o, Z_AttributeType **p, int opt, const char *name)
390 {
391 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
392 		return odr_missing(o, opt, name) && odr_ok (o);
393 	return
394 		odr_implicit_tag(o, z_InternationalString,
395 			&(*p)->name, ODR_CONTEXT, 0, 1, "name") &&
396 		odr_implicit_tag(o, z_HumanString,
397 			&(*p)->description, ODR_CONTEXT, 1, 1, "description") &&
398 		odr_implicit_tag(o, odr_integer,
399 			&(*p)->attributeType, ODR_CONTEXT, 2, 0, "attributeType") &&
400 		odr_implicit_settag(o, ODR_CONTEXT, 3) &&
401 		odr_sequence_of(o, (Odr_fun) z_AttributeDescription, &(*p)->attributeValues,
402 		  &(*p)->num_attributeValues, "attributeValues") &&
403 		odr_sequence_end(o);
404 }
405 
z_AttributeDescription(ODR o,Z_AttributeDescription ** p,int opt,const char * name)406 int z_AttributeDescription(ODR o, Z_AttributeDescription **p, int opt, const char *name)
407 {
408 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
409 		return odr_missing(o, opt, name) && odr_ok (o);
410 	return
411 		odr_implicit_tag(o, z_InternationalString,
412 			&(*p)->name, ODR_CONTEXT, 0, 1, "name") &&
413 		odr_implicit_tag(o, z_HumanString,
414 			&(*p)->description, ODR_CONTEXT, 1, 1, "description") &&
415 		odr_explicit_tag(o, z_StringOrNumeric,
416 			&(*p)->attributeValue, ODR_CONTEXT, 2, 0, "attributeValue") &&
417 		odr_implicit_settag(o, ODR_CONTEXT, 3) &&
418 		(odr_sequence_of(o, (Odr_fun) z_StringOrNumeric, &(*p)->equivalentAttributes,
419 		  &(*p)->num_equivalentAttributes, "equivalentAttributes") || odr_ok(o)) &&
420 		odr_sequence_end(o);
421 }
422 
z_TermListElement(ODR o,Z_TermListElement ** p,int opt,const char * name)423 int z_TermListElement(ODR o, Z_TermListElement **p, int opt, const char *name)
424 {
425 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
426 		return odr_missing(o, opt, name) && odr_ok (o);
427 	return
428 		odr_implicit_tag(o, z_InternationalString,
429 			&(*p)->name, ODR_CONTEXT, 1, 0, "name") &&
430 		odr_implicit_tag(o, z_HumanString,
431 			&(*p)->title, ODR_CONTEXT, 2, 1, "title") &&
432 		odr_implicit_tag(o, odr_integer,
433 			&(*p)->searchCost, ODR_CONTEXT, 3, 1, "searchCost") &&
434 		odr_implicit_tag(o, odr_bool,
435 			&(*p)->scanable, ODR_CONTEXT, 4, 0, "scanable") &&
436 		odr_implicit_settag(o, ODR_CONTEXT, 5) &&
437 		(odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->broader,
438 		  &(*p)->num_broader, "broader") || odr_ok(o)) &&
439 		odr_implicit_settag(o, ODR_CONTEXT, 6) &&
440 		(odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->narrower,
441 		  &(*p)->num_narrower, "narrower") || odr_ok(o)) &&
442 		odr_sequence_end(o);
443 }
444 
z_TermListInfo(ODR o,Z_TermListInfo ** p,int opt,const char * name)445 int z_TermListInfo(ODR o, Z_TermListInfo **p, int opt, const char *name)
446 {
447 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
448 		return odr_missing(o, opt, name) && odr_ok (o);
449 	return
450 		odr_implicit_tag(o, z_CommonInfo,
451 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
452 		odr_implicit_tag(o, z_DatabaseName,
453 			&(*p)->databaseName, ODR_CONTEXT, 1, 0, "databaseName") &&
454 		odr_implicit_settag(o, ODR_CONTEXT, 2) &&
455 		odr_sequence_of(o, (Odr_fun) z_TermListElement, &(*p)->termLists,
456 		  &(*p)->num_termLists, "termLists") &&
457 		odr_sequence_end(o);
458 }
459 
z_ExtendedServicesInfo(ODR o,Z_ExtendedServicesInfo ** p,int opt,const char * name)460 int z_ExtendedServicesInfo(ODR o, Z_ExtendedServicesInfo **p, int opt, const char *name)
461 {
462 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
463 		return odr_missing(o, opt, name) && odr_ok (o);
464 	return
465 		odr_implicit_tag(o, z_CommonInfo,
466 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
467 		odr_implicit_tag(o, odr_oid,
468 			&(*p)->type, ODR_CONTEXT, 1, 0, "type") &&
469 		odr_implicit_tag(o, z_InternationalString,
470 			&(*p)->name, ODR_CONTEXT, 2, 1, "name") &&
471 		odr_implicit_tag(o, odr_bool,
472 			&(*p)->privateType, ODR_CONTEXT, 3, 0, "privateType") &&
473 		odr_implicit_tag(o, odr_bool,
474 			&(*p)->restrictionsApply, ODR_CONTEXT, 5, 0, "restrictionsApply") &&
475 		odr_implicit_tag(o, odr_bool,
476 			&(*p)->feeApply, ODR_CONTEXT, 6, 0, "feeApply") &&
477 		odr_implicit_tag(o, odr_bool,
478 			&(*p)->available, ODR_CONTEXT, 7, 0, "available") &&
479 		odr_implicit_tag(o, odr_bool,
480 			&(*p)->retentionSupported, ODR_CONTEXT, 8, 0, "retentionSupported") &&
481 		odr_implicit_tag(o, odr_integer,
482 			&(*p)->waitAction, ODR_CONTEXT, 9, 0, "waitAction") &&
483 		odr_implicit_tag(o, z_HumanString,
484 			&(*p)->description, ODR_CONTEXT, 10, 1, "description") &&
485 		odr_implicit_tag(o, z_External,
486 			&(*p)->specificExplain, ODR_CONTEXT, 11, 1, "specificExplain") &&
487 		odr_implicit_tag(o, z_InternationalString,
488 			&(*p)->esASN, ODR_CONTEXT, 12, 1, "esASN") &&
489 		odr_sequence_end(o);
490 }
491 
z_AttributeDetails(ODR o,Z_AttributeDetails ** p,int opt,const char * name)492 int z_AttributeDetails(ODR o, Z_AttributeDetails **p, int opt, const char *name)
493 {
494 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
495 		return odr_missing(o, opt, name) && odr_ok (o);
496 	return
497 		odr_implicit_tag(o, z_CommonInfo,
498 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
499 		odr_implicit_tag(o, z_DatabaseName,
500 			&(*p)->databaseName, ODR_CONTEXT, 1, 0, "databaseName") &&
501 		odr_implicit_settag(o, ODR_CONTEXT, 2) &&
502 		(odr_sequence_of(o, (Odr_fun) z_AttributeSetDetails, &(*p)->attributesBySet,
503 		  &(*p)->num_attributesBySet, "attributesBySet") || odr_ok(o)) &&
504 		odr_implicit_tag(o, z_AttributeCombinations,
505 			&(*p)->attributeCombinations, ODR_CONTEXT, 3, 1, "attributeCombinations") &&
506 		odr_sequence_end(o);
507 }
508 
z_AttributeSetDetails(ODR o,Z_AttributeSetDetails ** p,int opt,const char * name)509 int z_AttributeSetDetails(ODR o, Z_AttributeSetDetails **p, int opt, const char *name)
510 {
511 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
512 		return odr_missing(o, opt, name) && odr_ok (o);
513 	return
514 		odr_implicit_tag(o, z_AttributeSetId,
515 			&(*p)->attributeSet, ODR_CONTEXT, 0, 0, "attributeSet") &&
516 		odr_implicit_settag(o, ODR_CONTEXT, 1) &&
517 		odr_sequence_of(o, (Odr_fun) z_AttributeTypeDetails, &(*p)->attributesByType,
518 		  &(*p)->num_attributesByType, "attributesByType") &&
519 		odr_sequence_end(o);
520 }
521 
z_AttributeTypeDetails(ODR o,Z_AttributeTypeDetails ** p,int opt,const char * name)522 int z_AttributeTypeDetails(ODR o, Z_AttributeTypeDetails **p, int opt, const char *name)
523 {
524 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
525 		return odr_missing(o, opt, name) && odr_ok (o);
526 	return
527 		odr_implicit_tag(o, odr_integer,
528 			&(*p)->attributeType, ODR_CONTEXT, 0, 0, "attributeType") &&
529 		odr_implicit_tag(o, z_OmittedAttributeInterpretation,
530 			&(*p)->defaultIfOmitted, ODR_CONTEXT, 1, 1, "defaultIfOmitted") &&
531 		odr_implicit_settag(o, ODR_CONTEXT, 2) &&
532 		(odr_sequence_of(o, (Odr_fun) z_AttributeValue, &(*p)->attributeValues,
533 		  &(*p)->num_attributeValues, "attributeValues") || odr_ok(o)) &&
534 		odr_sequence_end(o);
535 }
536 
z_OmittedAttributeInterpretation(ODR o,Z_OmittedAttributeInterpretation ** p,int opt,const char * name)537 int z_OmittedAttributeInterpretation(ODR o, Z_OmittedAttributeInterpretation **p, int opt, const char *name)
538 {
539 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
540 		return odr_missing(o, opt, name) && odr_ok (o);
541 	return
542 		odr_explicit_tag(o, z_StringOrNumeric,
543 			&(*p)->defaultValue, ODR_CONTEXT, 0, 1, "defaultValue") &&
544 		odr_implicit_tag(o, z_HumanString,
545 			&(*p)->defaultDescription, ODR_CONTEXT, 1, 1, "defaultDescription") &&
546 		odr_sequence_end(o);
547 }
548 
z_AttributeValue(ODR o,Z_AttributeValue ** p,int opt,const char * name)549 int z_AttributeValue(ODR o, Z_AttributeValue **p, int opt, const char *name)
550 {
551 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
552 		return odr_missing(o, opt, name) && odr_ok (o);
553 	return
554 		odr_explicit_tag(o, z_StringOrNumeric,
555 			&(*p)->value, ODR_CONTEXT, 0, 0, "value") &&
556 		odr_implicit_tag(o, z_HumanString,
557 			&(*p)->description, ODR_CONTEXT, 1, 1, "description") &&
558 		odr_implicit_settag(o, ODR_CONTEXT, 2) &&
559 		(odr_sequence_of(o, (Odr_fun) z_StringOrNumeric, &(*p)->subAttributes,
560 		  &(*p)->num_subAttributes, "subAttributes") || odr_ok(o)) &&
561 		odr_implicit_settag(o, ODR_CONTEXT, 3) &&
562 		(odr_sequence_of(o, (Odr_fun) z_StringOrNumeric, &(*p)->superAttributes,
563 		  &(*p)->num_superAttributes, "superAttributes") || odr_ok(o)) &&
564 		odr_implicit_tag(o, odr_null,
565 			&(*p)->partialSupport, ODR_CONTEXT, 4, 1, "partialSupport") &&
566 		odr_sequence_end(o);
567 }
568 
z_EScanInfo(ODR o,Z_EScanInfo ** p,int opt,const char * name)569 int z_EScanInfo(ODR o, Z_EScanInfo **p, int opt, const char *name)
570 {
571 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
572 		return odr_missing(o, opt, name) && odr_ok (o);
573 	return
574 		odr_implicit_tag(o, odr_integer,
575 			&(*p)->maxStepSize, ODR_CONTEXT, 0, 1, "maxStepSize") &&
576 		odr_implicit_tag(o, z_HumanString,
577 			&(*p)->collatingSequence, ODR_CONTEXT, 1, 1, "collatingSequence") &&
578 		odr_implicit_tag(o, odr_bool,
579 			&(*p)->increasing, ODR_CONTEXT, 2, 1, "increasing") &&
580 		odr_sequence_end(o);
581 }
582 
z_TermListDetails(ODR o,Z_TermListDetails ** p,int opt,const char * name)583 int z_TermListDetails(ODR o, Z_TermListDetails **p, int opt, const char *name)
584 {
585 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
586 		return odr_missing(o, opt, name) && odr_ok (o);
587 	return
588 		odr_implicit_tag(o, z_CommonInfo,
589 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
590 		odr_implicit_tag(o, z_InternationalString,
591 			&(*p)->termListName, ODR_CONTEXT, 1, 0, "termListName") &&
592 		odr_implicit_tag(o, z_HumanString,
593 			&(*p)->description, ODR_CONTEXT, 2, 1, "description") &&
594 		odr_implicit_tag(o, z_AttributeCombinations,
595 			&(*p)->attributes, ODR_CONTEXT, 3, 1, "attributes") &&
596 		odr_implicit_tag(o, z_EScanInfo,
597 			&(*p)->scanInfo, ODR_CONTEXT, 4, 1, "scanInfo") &&
598 		odr_implicit_tag(o, odr_integer,
599 			&(*p)->estNumberTerms, ODR_CONTEXT, 5, 1, "estNumberTerms") &&
600 		odr_implicit_settag(o, ODR_CONTEXT, 6) &&
601 		(odr_sequence_of(o, (Odr_fun) z_Term, &(*p)->sampleTerms,
602 		  &(*p)->num_sampleTerms, "sampleTerms") || odr_ok(o)) &&
603 		odr_sequence_end(o);
604 }
605 
z_ElementSetDetails(ODR o,Z_ElementSetDetails ** p,int opt,const char * name)606 int z_ElementSetDetails(ODR o, Z_ElementSetDetails **p, int opt, const char *name)
607 {
608 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
609 		return odr_missing(o, opt, name) && odr_ok (o);
610 	return
611 		odr_implicit_tag(o, z_CommonInfo,
612 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
613 		odr_implicit_tag(o, z_DatabaseName,
614 			&(*p)->databaseName, ODR_CONTEXT, 1, 0, "databaseName") &&
615 		odr_implicit_tag(o, z_ElementSetName,
616 			&(*p)->elementSetName, ODR_CONTEXT, 2, 0, "elementSetName") &&
617 		odr_implicit_tag(o, odr_oid,
618 			&(*p)->recordSyntax, ODR_CONTEXT, 3, 0, "recordSyntax") &&
619 		odr_implicit_tag(o, odr_oid,
620 			&(*p)->schema, ODR_CONTEXT, 4, 0, "schema") &&
621 		odr_implicit_tag(o, z_HumanString,
622 			&(*p)->description, ODR_CONTEXT, 5, 1, "description") &&
623 		odr_implicit_settag(o, ODR_CONTEXT, 6) &&
624 		(odr_sequence_of(o, (Odr_fun) z_PerElementDetails, &(*p)->detailsPerElement,
625 		  &(*p)->num_detailsPerElement, "detailsPerElement") || odr_ok(o)) &&
626 		odr_sequence_end(o);
627 }
628 
z_RetrievalRecordDetails(ODR o,Z_RetrievalRecordDetails ** p,int opt,const char * name)629 int z_RetrievalRecordDetails(ODR o, Z_RetrievalRecordDetails **p, int opt, const char *name)
630 {
631 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
632 		return odr_missing(o, opt, name) && odr_ok (o);
633 	return
634 		odr_implicit_tag(o, z_CommonInfo,
635 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
636 		odr_implicit_tag(o, z_DatabaseName,
637 			&(*p)->databaseName, ODR_CONTEXT, 1, 0, "databaseName") &&
638 		odr_implicit_tag(o, odr_oid,
639 			&(*p)->schema, ODR_CONTEXT, 2, 0, "schema") &&
640 		odr_implicit_tag(o, odr_oid,
641 			&(*p)->recordSyntax, ODR_CONTEXT, 3, 0, "recordSyntax") &&
642 		odr_implicit_tag(o, z_HumanString,
643 			&(*p)->description, ODR_CONTEXT, 4, 1, "description") &&
644 		odr_implicit_settag(o, ODR_CONTEXT, 5) &&
645 		(odr_sequence_of(o, (Odr_fun) z_PerElementDetails, &(*p)->detailsPerElement,
646 		  &(*p)->num_detailsPerElement, "detailsPerElement") || odr_ok(o)) &&
647 		odr_sequence_end(o);
648 }
649 
z_PerElementDetails(ODR o,Z_PerElementDetails ** p,int opt,const char * name)650 int z_PerElementDetails(ODR o, Z_PerElementDetails **p, int opt, const char *name)
651 {
652 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
653 		return odr_missing(o, opt, name) && odr_ok (o);
654 	return
655 		odr_implicit_tag(o, z_InternationalString,
656 			&(*p)->name, ODR_CONTEXT, 0, 1, "name") &&
657 		odr_implicit_tag(o, z_RecordTag,
658 			&(*p)->recordTag, ODR_CONTEXT, 1, 1, "recordTag") &&
659 		odr_implicit_settag(o, ODR_CONTEXT, 2) &&
660 		(odr_sequence_of(o, (Odr_fun) z_Path, &(*p)->schemaTags,
661 		  &(*p)->num_schemaTags, "schemaTags") || odr_ok(o)) &&
662 		odr_implicit_tag(o, odr_integer,
663 			&(*p)->maxSize, ODR_CONTEXT, 3, 1, "maxSize") &&
664 		odr_implicit_tag(o, odr_integer,
665 			&(*p)->minSize, ODR_CONTEXT, 4, 1, "minSize") &&
666 		odr_implicit_tag(o, odr_integer,
667 			&(*p)->avgSize, ODR_CONTEXT, 5, 1, "avgSize") &&
668 		odr_implicit_tag(o, odr_integer,
669 			&(*p)->fixedSize, ODR_CONTEXT, 6, 1, "fixedSize") &&
670 		odr_implicit_tag(o, odr_bool,
671 			&(*p)->repeatable, ODR_CONTEXT, 8, 0, "repeatable") &&
672 		odr_implicit_tag(o, odr_bool,
673 			&(*p)->required, ODR_CONTEXT, 9, 0, "required") &&
674 		odr_implicit_tag(o, z_HumanString,
675 			&(*p)->description, ODR_CONTEXT, 12, 1, "description") &&
676 		odr_implicit_tag(o, z_HumanString,
677 			&(*p)->contents, ODR_CONTEXT, 13, 1, "contents") &&
678 		odr_implicit_tag(o, z_HumanString,
679 			&(*p)->billingInfo, ODR_CONTEXT, 14, 1, "billingInfo") &&
680 		odr_implicit_tag(o, z_HumanString,
681 			&(*p)->restrictions, ODR_CONTEXT, 15, 1, "restrictions") &&
682 		odr_implicit_settag(o, ODR_CONTEXT, 16) &&
683 		(odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->alternateNames,
684 		  &(*p)->num_alternateNames, "alternateNames") || odr_ok(o)) &&
685 		odr_implicit_settag(o, ODR_CONTEXT, 17) &&
686 		(odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->genericNames,
687 		  &(*p)->num_genericNames, "genericNames") || odr_ok(o)) &&
688 		odr_implicit_tag(o, z_AttributeCombinations,
689 			&(*p)->searchAccess, ODR_CONTEXT, 18, 1, "searchAccess") &&
690 		odr_sequence_end(o);
691 }
692 
z_RecordTag(ODR o,Z_RecordTag ** p,int opt,const char * name)693 int z_RecordTag(ODR o, Z_RecordTag **p, int opt, const char *name)
694 {
695 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
696 		return odr_missing(o, opt, name) && odr_ok (o);
697 	return
698 		odr_explicit_tag(o, z_StringOrNumeric,
699 			&(*p)->qualifier, ODR_CONTEXT, 0, 1, "qualifier") &&
700 		odr_explicit_tag(o, z_StringOrNumeric,
701 			&(*p)->tagValue, ODR_CONTEXT, 1, 0, "tagValue") &&
702 		odr_sequence_end(o);
703 }
704 
z_SortDetails(ODR o,Z_SortDetails ** p,int opt,const char * name)705 int z_SortDetails(ODR o, Z_SortDetails **p, int opt, const char *name)
706 {
707 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
708 		return odr_missing(o, opt, name) && odr_ok (o);
709 	return
710 		odr_implicit_tag(o, z_CommonInfo,
711 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
712 		odr_implicit_tag(o, z_DatabaseName,
713 			&(*p)->databaseName, ODR_CONTEXT, 1, 0, "databaseName") &&
714 		odr_implicit_settag(o, ODR_CONTEXT, 2) &&
715 		(odr_sequence_of(o, (Odr_fun) z_SortKeyDetails, &(*p)->sortKeys,
716 		  &(*p)->num_sortKeys, "sortKeys") || odr_ok(o)) &&
717 		odr_sequence_end(o);
718 }
719 
z_SortKeyDetails(ODR o,Z_SortKeyDetails ** p,int opt,const char * name)720 int z_SortKeyDetails(ODR o, Z_SortKeyDetails **p, int opt, const char *name)
721 {
722 	static Odr_arm arm[] = {
723 		{ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKeyDetails_character,
724 		(Odr_fun) odr_null, "character"},
725 		{ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKeyDetails_numeric,
726 		(Odr_fun) odr_null, "numeric"},
727 		{ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKeyDetails_structured,
728 		(Odr_fun) z_HumanString, "structured"},
729 		{-1, -1, -1, -1, (Odr_fun) 0, 0}
730 	};
731 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
732 		return odr_missing(o, opt, name) && odr_ok (o);
733 	return
734 		odr_implicit_tag(o, z_HumanString,
735 			&(*p)->description, ODR_CONTEXT, 0, 1, "description") &&
736 		odr_implicit_settag(o, ODR_CONTEXT, 1) &&
737 		(odr_sequence_of(o, (Odr_fun) z_Specification, &(*p)->elementSpecifications,
738 		  &(*p)->num_elementSpecifications, "elementSpecifications") || odr_ok(o)) &&
739 		odr_implicit_tag(o, z_AttributeCombinations,
740 			&(*p)->attributeSpecifications, ODR_CONTEXT, 2, 1, "attributeSpecifications") &&
741 		((odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 3, "sortType") &&
742 		odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
743 		odr_constructed_end(o)) || odr_ok(o)) &&
744 		odr_implicit_tag(o, odr_integer,
745 			&(*p)->caseSensitivity, ODR_CONTEXT, 4, 1, "caseSensitivity") &&
746 		odr_sequence_end(o);
747 }
748 
z_ProcessingInformation(ODR o,Z_ProcessingInformation ** p,int opt,const char * name)749 int z_ProcessingInformation(ODR o, Z_ProcessingInformation **p, int opt, const char *name)
750 {
751 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
752 		return odr_missing(o, opt, name) && odr_ok (o);
753 	return
754 		odr_implicit_tag(o, z_CommonInfo,
755 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
756 		odr_implicit_tag(o, z_DatabaseName,
757 			&(*p)->databaseName, ODR_CONTEXT, 1, 0, "databaseName") &&
758 		odr_implicit_tag(o, odr_integer,
759 			&(*p)->processingContext, ODR_CONTEXT, 2, 0, "processingContext") &&
760 		odr_implicit_tag(o, z_InternationalString,
761 			&(*p)->name, ODR_CONTEXT, 3, 0, "name") &&
762 		odr_implicit_tag(o, odr_oid,
763 			&(*p)->oid, ODR_CONTEXT, 4, 0, "oid") &&
764 		odr_implicit_tag(o, z_HumanString,
765 			&(*p)->description, ODR_CONTEXT, 5, 1, "description") &&
766 		odr_implicit_tag(o, z_External,
767 			&(*p)->instructions, ODR_CONTEXT, 6, 1, "instructions") &&
768 		odr_sequence_end(o);
769 }
770 
z_VariantSetInfo(ODR o,Z_VariantSetInfo ** p,int opt,const char * name)771 int z_VariantSetInfo(ODR o, Z_VariantSetInfo **p, int opt, const char *name)
772 {
773 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
774 		return odr_missing(o, opt, name) && odr_ok (o);
775 	return
776 		odr_implicit_tag(o, z_CommonInfo,
777 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
778 		odr_implicit_tag(o, odr_oid,
779 			&(*p)->variantSet, ODR_CONTEXT, 1, 0, "variantSet") &&
780 		odr_implicit_tag(o, z_InternationalString,
781 			&(*p)->name, ODR_CONTEXT, 2, 0, "name") &&
782 		odr_implicit_settag(o, ODR_CONTEXT, 3) &&
783 		(odr_sequence_of(o, (Odr_fun) z_VariantClass, &(*p)->variants,
784 		  &(*p)->num_variants, "variants") || odr_ok(o)) &&
785 		odr_sequence_end(o);
786 }
787 
z_VariantClass(ODR o,Z_VariantClass ** p,int opt,const char * name)788 int z_VariantClass(ODR o, Z_VariantClass **p, int opt, const char *name)
789 {
790 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
791 		return odr_missing(o, opt, name) && odr_ok (o);
792 	return
793 		odr_implicit_tag(o, z_InternationalString,
794 			&(*p)->name, ODR_CONTEXT, 0, 1, "name") &&
795 		odr_implicit_tag(o, z_HumanString,
796 			&(*p)->description, ODR_CONTEXT, 1, 1, "description") &&
797 		odr_implicit_tag(o, odr_integer,
798 			&(*p)->variantClass, ODR_CONTEXT, 2, 0, "variantClass") &&
799 		odr_implicit_settag(o, ODR_CONTEXT, 3) &&
800 		odr_sequence_of(o, (Odr_fun) z_VariantType, &(*p)->variantTypes,
801 		  &(*p)->num_variantTypes, "variantTypes") &&
802 		odr_sequence_end(o);
803 }
804 
z_VariantType(ODR o,Z_VariantType ** p,int opt,const char * name)805 int z_VariantType(ODR o, Z_VariantType **p, int opt, const char *name)
806 {
807 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
808 		return odr_missing(o, opt, name) && odr_ok (o);
809 	return
810 		odr_implicit_tag(o, z_InternationalString,
811 			&(*p)->name, ODR_CONTEXT, 0, 1, "name") &&
812 		odr_implicit_tag(o, z_HumanString,
813 			&(*p)->description, ODR_CONTEXT, 1, 1, "description") &&
814 		odr_implicit_tag(o, odr_integer,
815 			&(*p)->variantType, ODR_CONTEXT, 2, 0, "variantType") &&
816 		odr_implicit_tag(o, z_VariantValue,
817 			&(*p)->variantValue, ODR_CONTEXT, 3, 1, "variantValue") &&
818 		odr_sequence_end(o);
819 }
820 
z_VariantValue(ODR o,Z_VariantValue ** p,int opt,const char * name)821 int z_VariantValue(ODR o, Z_VariantValue **p, int opt, const char *name)
822 {
823 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
824 		return odr_missing(o, opt, name) && odr_ok (o);
825 	return
826 		odr_explicit_tag(o, z_PrimitiveDataType,
827 			&(*p)->dataType, ODR_CONTEXT, 0, 0, "dataType") &&
828 		odr_explicit_tag(o, z_ValueSet,
829 			&(*p)->values, ODR_CONTEXT, 1, 1, "values") &&
830 		odr_sequence_end(o);
831 }
832 
z_ValueSetEnumerated(ODR o,Z_ValueSetEnumerated ** p,int opt,const char * name)833 int z_ValueSetEnumerated(ODR o, Z_ValueSetEnumerated **p, int opt, const char *name)
834 {
835 	if (!odr_initmember(o, p, sizeof(**p)))
836 		return odr_missing(o, opt, name);
837 	if (odr_sequence_of(o, (Odr_fun) z_ValueDescription, &(*p)->elements,
838 		&(*p)->num, name))
839 		return 1;
840 	if (o->direction == ODR_DECODE)
841 		*p = 0;
842 	return odr_missing(o, opt, name);
843 }
844 
z_ValueSet(ODR o,Z_ValueSet ** p,int opt,const char * name)845 int z_ValueSet(ODR o, Z_ValueSet **p, int opt, const char *name)
846 {
847 	static Odr_arm arm[] = {
848 		{ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ValueSet_range,
849 		(Odr_fun) z_ValueRange, "range"},
850 		{ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ValueSet_enumerated,
851 		(Odr_fun) z_ValueSetEnumerated, "enumerated"},
852 		{-1, -1, -1, -1, (Odr_fun) 0, 0}
853 	};
854 	if (!odr_initmember(o, p, sizeof(**p)))
855 		return odr_missing(o, opt, name);
856 	if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
857 		return 1;
858 	if (o->direction == ODR_DECODE)
859 		*p = 0;
860 	return odr_missing(o, opt, name);
861 }
862 
z_ValueRange(ODR o,Z_ValueRange ** p,int opt,const char * name)863 int z_ValueRange(ODR o, Z_ValueRange **p, int opt, const char *name)
864 {
865 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
866 		return odr_missing(o, opt, name) && odr_ok (o);
867 	return
868 		odr_explicit_tag(o, z_ValueDescription,
869 			&(*p)->lower, ODR_CONTEXT, 0, 1, "lower") &&
870 		odr_explicit_tag(o, z_ValueDescription,
871 			&(*p)->upper, ODR_CONTEXT, 1, 1, "upper") &&
872 		odr_sequence_end(o);
873 }
874 
z_ValueDescription(ODR o,Z_ValueDescription ** p,int opt,const char * name)875 int z_ValueDescription(ODR o, Z_ValueDescription **p, int opt, const char *name)
876 {
877 	static Odr_arm arm[] = {
878 		{-1, -1, -1, Z_ValueDescription_integer,
879 		 (Odr_fun) odr_integer, "integer"},
880 		{-1, -1, -1, Z_ValueDescription_string,
881 		 (Odr_fun) z_InternationalString, "string"},
882 		{-1, -1, -1, Z_ValueDescription_octets,
883 		 (Odr_fun) odr_octetstring, "octets"},
884 		{-1, -1, -1, Z_ValueDescription_oid,
885 		 (Odr_fun) odr_oid, "oid"},
886 		{ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ValueDescription_unit,
887 		(Odr_fun) z_Unit, "unit"},
888 		{ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ValueDescription_valueAndUnit,
889 		(Odr_fun) z_IntUnit, "valueAndUnit"},
890 		{-1, -1, -1, -1, (Odr_fun) 0, 0}
891 	};
892 	if (!odr_initmember(o, p, sizeof(**p)))
893 		return odr_missing(o, opt, name);
894 	if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
895 		return 1;
896 	if (o->direction == ODR_DECODE)
897 		*p = 0;
898 	return odr_missing(o, opt, name);
899 }
900 
z_UnitInfo(ODR o,Z_UnitInfo ** p,int opt,const char * name)901 int z_UnitInfo(ODR o, Z_UnitInfo **p, int opt, const char *name)
902 {
903 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
904 		return odr_missing(o, opt, name) && odr_ok (o);
905 	return
906 		odr_implicit_tag(o, z_CommonInfo,
907 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
908 		odr_implicit_tag(o, z_InternationalString,
909 			&(*p)->unitSystem, ODR_CONTEXT, 1, 0, "unitSystem") &&
910 		odr_implicit_tag(o, z_HumanString,
911 			&(*p)->description, ODR_CONTEXT, 2, 1, "description") &&
912 		odr_implicit_settag(o, ODR_CONTEXT, 3) &&
913 		(odr_sequence_of(o, (Odr_fun) z_UnitType, &(*p)->units,
914 		  &(*p)->num_units, "units") || odr_ok(o)) &&
915 		odr_sequence_end(o);
916 }
917 
z_UnitType(ODR o,Z_UnitType ** p,int opt,const char * name)918 int z_UnitType(ODR o, Z_UnitType **p, int opt, const char *name)
919 {
920 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
921 		return odr_missing(o, opt, name) && odr_ok (o);
922 	return
923 		odr_implicit_tag(o, z_InternationalString,
924 			&(*p)->name, ODR_CONTEXT, 0, 1, "name") &&
925 		odr_implicit_tag(o, z_HumanString,
926 			&(*p)->description, ODR_CONTEXT, 1, 1, "description") &&
927 		odr_explicit_tag(o, z_StringOrNumeric,
928 			&(*p)->unitType, ODR_CONTEXT, 2, 0, "unitType") &&
929 		odr_implicit_settag(o, ODR_CONTEXT, 3) &&
930 		odr_sequence_of(o, (Odr_fun) z_Units, &(*p)->units,
931 		  &(*p)->num_units, "units") &&
932 		odr_sequence_end(o);
933 }
934 
z_Units(ODR o,Z_Units ** p,int opt,const char * name)935 int z_Units(ODR o, Z_Units **p, int opt, const char *name)
936 {
937 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
938 		return odr_missing(o, opt, name) && odr_ok (o);
939 	return
940 		odr_implicit_tag(o, z_InternationalString,
941 			&(*p)->name, ODR_CONTEXT, 0, 1, "name") &&
942 		odr_implicit_tag(o, z_HumanString,
943 			&(*p)->description, ODR_CONTEXT, 1, 1, "description") &&
944 		odr_explicit_tag(o, z_StringOrNumeric,
945 			&(*p)->unit, ODR_CONTEXT, 2, 0, "unit") &&
946 		odr_sequence_end(o);
947 }
948 
z_CategoryList(ODR o,Z_CategoryList ** p,int opt,const char * name)949 int z_CategoryList(ODR o, Z_CategoryList **p, int opt, const char *name)
950 {
951 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
952 		return odr_missing(o, opt, name) && odr_ok (o);
953 	return
954 		odr_implicit_tag(o, z_CommonInfo,
955 			&(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") &&
956 		odr_implicit_settag(o, ODR_CONTEXT, 1) &&
957 		odr_sequence_of(o, (Odr_fun) z_CategoryInfo, &(*p)->categories,
958 		  &(*p)->num_categories, "categories") &&
959 		odr_sequence_end(o);
960 }
961 
z_CategoryInfo(ODR o,Z_CategoryInfo ** p,int opt,const char * name)962 int z_CategoryInfo(ODR o, Z_CategoryInfo **p, int opt, const char *name)
963 {
964 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
965 		return odr_missing(o, opt, name) && odr_ok (o);
966 	return
967 		odr_implicit_tag(o, z_InternationalString,
968 			&(*p)->category, ODR_CONTEXT, 1, 0, "category") &&
969 		odr_implicit_tag(o, z_InternationalString,
970 			&(*p)->originalCategory, ODR_CONTEXT, 2, 1, "originalCategory") &&
971 		odr_implicit_tag(o, z_HumanString,
972 			&(*p)->description, ODR_CONTEXT, 3, 1, "description") &&
973 		odr_implicit_tag(o, z_InternationalString,
974 			&(*p)->asn1Module, ODR_CONTEXT, 4, 1, "asn1Module") &&
975 		odr_sequence_end(o);
976 }
977 
z_CommonInfo(ODR o,Z_CommonInfo ** p,int opt,const char * name)978 int z_CommonInfo(ODR o, Z_CommonInfo **p, int opt, const char *name)
979 {
980 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
981 		return odr_missing(o, opt, name) && odr_ok (o);
982 	return
983 		odr_implicit_tag(o, odr_generalizedtime,
984 			&(*p)->dateAdded, ODR_CONTEXT, 0, 1, "dateAdded") &&
985 		odr_implicit_tag(o, odr_generalizedtime,
986 			&(*p)->dateChanged, ODR_CONTEXT, 1, 1, "dateChanged") &&
987 		odr_implicit_tag(o, odr_generalizedtime,
988 			&(*p)->expiry, ODR_CONTEXT, 2, 1, "expiry") &&
989 		odr_implicit_tag(o, z_LanguageCode,
990 			&(*p)->humanStringLanguage, ODR_CONTEXT, 3, 1, "humanStringLanguage") &&
991 		z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
992 		odr_sequence_end(o);
993 }
994 
z_HumanStringUnit(ODR o,Z_HumanStringUnit ** p,int opt,const char * name)995 int z_HumanStringUnit(ODR o, Z_HumanStringUnit **p, int opt, const char *name)
996 {
997 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
998 		return odr_missing(o, opt, name) && odr_ok (o);
999 	return
1000 		odr_implicit_tag(o, z_LanguageCode,
1001 			&(*p)->language, ODR_CONTEXT, 0, 1, "language") &&
1002 		odr_implicit_tag(o, z_InternationalString,
1003 			&(*p)->text, ODR_CONTEXT, 1, 0, "text") &&
1004 		odr_sequence_end(o);
1005 }
1006 
z_HumanString(ODR o,Z_HumanString ** p,int opt,const char * name)1007 int z_HumanString(ODR o, Z_HumanString **p, int opt, const char *name)
1008 {
1009 	if (!odr_initmember(o, p, sizeof(**p)))
1010 		return odr_missing(o, opt, name);
1011 	if (odr_sequence_of(o, (Odr_fun) z_HumanStringUnit, &(*p)->strings,
1012 		&(*p)->num_strings, name))
1013 		return 1;
1014 	if (o->direction == ODR_DECODE)
1015 		*p = 0;
1016 	return odr_missing(o, opt, name);
1017 }
1018 
z_IconObjectUnit(ODR o,Z_IconObjectUnit ** p,int opt,const char * name)1019 int z_IconObjectUnit(ODR o, Z_IconObjectUnit **p, int opt, const char *name)
1020 {
1021 	static Odr_arm arm[] = {
1022 		{ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IconObjectUnit_ianaType,
1023 		(Odr_fun) z_InternationalString, "ianaType"},
1024 		{ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IconObjectUnit_z3950type,
1025 		(Odr_fun) z_InternationalString, "z3950type"},
1026 		{ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IconObjectUnit_otherType,
1027 		(Odr_fun) z_InternationalString, "otherType"},
1028 		{-1, -1, -1, -1, (Odr_fun) 0, 0}
1029 	};
1030 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1031 		return odr_missing(o, opt, name) && odr_ok (o);
1032 	return
1033 		odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 1, "bodyType") &&
1034 		odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
1035 		odr_constructed_end(o) &&
1036 		odr_implicit_tag(o, odr_octetstring,
1037 			&(*p)->content, ODR_CONTEXT, 2, 0, "content") &&
1038 		odr_sequence_end(o);
1039 }
1040 
z_IconObject(ODR o,Z_IconObject ** p,int opt,const char * name)1041 int z_IconObject(ODR o, Z_IconObject **p, int opt, const char *name)
1042 {
1043 	if (!odr_initmember(o, p, sizeof(**p)))
1044 		return odr_missing(o, opt, name);
1045 	if (odr_sequence_of(o, (Odr_fun) z_IconObjectUnit, &(*p)->elements,
1046 		&(*p)->num, name))
1047 		return 1;
1048 	if (o->direction == ODR_DECODE)
1049 		*p = 0;
1050 	return odr_missing(o, opt, name);
1051 }
1052 
z_LanguageCode(ODR o,Z_LanguageCode ** p,int opt,const char * name)1053 int z_LanguageCode(ODR o, Z_LanguageCode **p, int opt, const char *name)
1054 {
1055 	return z_InternationalString (o, p, opt, name);
1056 }
1057 
z_ContactInfo(ODR o,Z_ContactInfo ** p,int opt,const char * name)1058 int z_ContactInfo(ODR o, Z_ContactInfo **p, int opt, const char *name)
1059 {
1060 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1061 		return odr_missing(o, opt, name) && odr_ok (o);
1062 	return
1063 		odr_implicit_tag(o, z_InternationalString,
1064 			&(*p)->name, ODR_CONTEXT, 0, 1, "name") &&
1065 		odr_implicit_tag(o, z_HumanString,
1066 			&(*p)->description, ODR_CONTEXT, 1, 1, "description") &&
1067 		odr_implicit_tag(o, z_HumanString,
1068 			&(*p)->address, ODR_CONTEXT, 2, 1, "address") &&
1069 		odr_implicit_tag(o, z_InternationalString,
1070 			&(*p)->email, ODR_CONTEXT, 3, 1, "email") &&
1071 		odr_implicit_tag(o, z_InternationalString,
1072 			&(*p)->phone, ODR_CONTEXT, 4, 1, "phone") &&
1073 		odr_sequence_end(o);
1074 }
1075 
z_NetworkAddressIA(ODR o,Z_NetworkAddressIA ** p,int opt,const char * name)1076 int z_NetworkAddressIA(ODR o, Z_NetworkAddressIA **p, int opt, const char *name)
1077 {
1078 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1079 		return odr_missing(o, opt, name) && odr_ok (o);
1080 	return
1081 		odr_implicit_tag(o, z_InternationalString,
1082 			&(*p)->hostAddress, ODR_CONTEXT, 0, 0, "hostAddress") &&
1083 		odr_implicit_tag(o, odr_integer,
1084 			&(*p)->port, ODR_CONTEXT, 1, 0, "port") &&
1085 		odr_sequence_end(o);
1086 }
1087 
z_NetworkAddressOPA(ODR o,Z_NetworkAddressOPA ** p,int opt,const char * name)1088 int z_NetworkAddressOPA(ODR o, Z_NetworkAddressOPA **p, int opt, const char *name)
1089 {
1090 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1091 		return odr_missing(o, opt, name) && odr_ok (o);
1092 	return
1093 		odr_implicit_tag(o, z_InternationalString,
1094 			&(*p)->pSel, ODR_CONTEXT, 0, 0, "pSel") &&
1095 		odr_implicit_tag(o, z_InternationalString,
1096 			&(*p)->sSel, ODR_CONTEXT, 1, 1, "sSel") &&
1097 		odr_implicit_tag(o, z_InternationalString,
1098 			&(*p)->tSel, ODR_CONTEXT, 2, 1, "tSel") &&
1099 		odr_implicit_tag(o, z_InternationalString,
1100 			&(*p)->nSap, ODR_CONTEXT, 3, 0, "nSap") &&
1101 		odr_sequence_end(o);
1102 }
1103 
z_NetworkAddressOther(ODR o,Z_NetworkAddressOther ** p,int opt,const char * name)1104 int z_NetworkAddressOther(ODR o, Z_NetworkAddressOther **p, int opt, const char *name)
1105 {
1106 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1107 		return odr_missing(o, opt, name) && odr_ok (o);
1108 	return
1109 		odr_implicit_tag(o, z_InternationalString,
1110 			&(*p)->type, ODR_CONTEXT, 0, 0, "type") &&
1111 		odr_implicit_tag(o, z_InternationalString,
1112 			&(*p)->address, ODR_CONTEXT, 1, 0, "address") &&
1113 		odr_sequence_end(o);
1114 }
1115 
z_NetworkAddress(ODR o,Z_NetworkAddress ** p,int opt,const char * name)1116 int z_NetworkAddress(ODR o, Z_NetworkAddress **p, int opt, const char *name)
1117 {
1118 	static Odr_arm arm[] = {
1119 		{ODR_IMPLICIT, ODR_CONTEXT, 0, Z_NetworkAddress_iA,
1120 		(Odr_fun) z_NetworkAddressIA, "internetAddress"},
1121 		{ODR_IMPLICIT, ODR_CONTEXT, 1, Z_NetworkAddress_oPA,
1122 		(Odr_fun) z_NetworkAddressOPA, "osiPresentationAddress"},
1123 		{ODR_IMPLICIT, ODR_CONTEXT, 2, Z_NetworkAddress_other,
1124 		(Odr_fun) z_NetworkAddressOther, "other"},
1125 		{-1, -1, -1, -1, (Odr_fun) 0, 0}
1126 	};
1127 	if (!odr_initmember(o, p, sizeof(**p)))
1128 		return odr_missing(o, opt, name);
1129 	if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
1130 		return 1;
1131 	if (o->direction == ODR_DECODE)
1132 		*p = 0;
1133 	return odr_missing(o, opt, name);
1134 }
1135 
z_AccessInfo(ODR o,Z_AccessInfo ** p,int opt,const char * name)1136 int z_AccessInfo(ODR o, Z_AccessInfo **p, int opt, const char *name)
1137 {
1138 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1139 		return odr_missing(o, opt, name) && odr_ok (o);
1140 	return
1141 		odr_implicit_settag(o, ODR_CONTEXT, 0) &&
1142 		(odr_sequence_of(o, (Odr_fun) z_QueryTypeDetails, &(*p)->queryTypesSupported,
1143 		  &(*p)->num_queryTypesSupported, "queryTypesSupported") || odr_ok(o)) &&
1144 		odr_implicit_settag(o, ODR_CONTEXT, 1) &&
1145 		(odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->diagnosticsSets,
1146 		  &(*p)->num_diagnosticsSets, "diagnosticsSets") || odr_ok(o)) &&
1147 		odr_implicit_settag(o, ODR_CONTEXT, 2) &&
1148 		(odr_sequence_of(o, (Odr_fun) z_AttributeSetId, &(*p)->attributeSetIds,
1149 		  &(*p)->num_attributeSetIds, "attributeSetIds") || odr_ok(o)) &&
1150 		odr_implicit_settag(o, ODR_CONTEXT, 3) &&
1151 		(odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->schemas,
1152 		  &(*p)->num_schemas, "schemas") || odr_ok(o)) &&
1153 		odr_implicit_settag(o, ODR_CONTEXT, 4) &&
1154 		(odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->recordSyntaxes,
1155 		  &(*p)->num_recordSyntaxes, "recordSyntaxes") || odr_ok(o)) &&
1156 		odr_implicit_settag(o, ODR_CONTEXT, 5) &&
1157 		(odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->resourceChallenges,
1158 		  &(*p)->num_resourceChallenges, "resourceChallenges") || odr_ok(o)) &&
1159 		odr_implicit_tag(o, z_AccessRestrictions,
1160 			&(*p)->restrictedAccess, ODR_CONTEXT, 6, 1, "restrictedAccess") &&
1161 		odr_implicit_tag(o, z_Costs,
1162 			&(*p)->costInfo, ODR_CONTEXT, 8, 1, "costInfo") &&
1163 		odr_implicit_settag(o, ODR_CONTEXT, 9) &&
1164 		(odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->variantSets,
1165 		  &(*p)->num_variantSets, "variantSets") || odr_ok(o)) &&
1166 		odr_implicit_settag(o, ODR_CONTEXT, 10) &&
1167 		(odr_sequence_of(o, (Odr_fun) z_ElementSetName, &(*p)->elementSetNames,
1168 		  &(*p)->num_elementSetNames, "elementSetNames") || odr_ok(o)) &&
1169 		odr_implicit_settag(o, ODR_CONTEXT, 11) &&
1170 		odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->unitSystems,
1171 		  &(*p)->num_unitSystems, "unitSystems") &&
1172 		odr_sequence_end(o);
1173 }
1174 
z_QueryTypeDetails(ODR o,Z_QueryTypeDetails ** p,int opt,const char * name)1175 int z_QueryTypeDetails(ODR o, Z_QueryTypeDetails **p, int opt, const char *name)
1176 {
1177 	static Odr_arm arm[] = {
1178 		{ODR_IMPLICIT, ODR_CONTEXT, 0, Z_QueryTypeDetails_private,
1179 		(Odr_fun) z_PrivateCapabilities, "zprivate"},
1180 		{ODR_IMPLICIT, ODR_CONTEXT, 1, Z_QueryTypeDetails_rpn,
1181 		(Odr_fun) z_RpnCapabilities, "rpn"},
1182 		{ODR_IMPLICIT, ODR_CONTEXT, 2, Z_QueryTypeDetails_iso8777,
1183 		(Odr_fun) z_Iso8777Capabilities, "iso8777"},
1184 		{ODR_IMPLICIT, ODR_CONTEXT, 100, Z_QueryTypeDetails_z39_58,
1185 		(Odr_fun) z_HumanString, "z39_58"},
1186 		{ODR_IMPLICIT, ODR_CONTEXT, 101, Z_QueryTypeDetails_erpn,
1187 		(Odr_fun) z_RpnCapabilities, "erpn"},
1188 		{ODR_IMPLICIT, ODR_CONTEXT, 102, Z_QueryTypeDetails_rankedList,
1189 		(Odr_fun) z_HumanString, "rankedList"},
1190 		{-1, -1, -1, -1, (Odr_fun) 0, 0}
1191 	};
1192 	if (!odr_initmember(o, p, sizeof(**p)))
1193 		return odr_missing(o, opt, name);
1194 	if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
1195 		return 1;
1196 	if (o->direction == ODR_DECODE)
1197 		*p = 0;
1198 	return odr_missing(o, opt, name);
1199 }
1200 
z_PrivateCapOperator(ODR o,Z_PrivateCapOperator ** p,int opt,const char * name)1201 int z_PrivateCapOperator(ODR o, Z_PrivateCapOperator **p, int opt, const char *name)
1202 {
1203 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1204 		return odr_missing(o, opt, name) && odr_ok (o);
1205 	return
1206 		odr_implicit_tag(o, z_InternationalString,
1207 			&(*p)->roperator, ODR_CONTEXT, 0, 0, "roperator") &&
1208 		odr_implicit_tag(o, z_HumanString,
1209 			&(*p)->description, ODR_CONTEXT, 1, 1, "description") &&
1210 		odr_sequence_end(o);
1211 }
1212 
z_PrivateCapabilities(ODR o,Z_PrivateCapabilities ** p,int opt,const char * name)1213 int z_PrivateCapabilities(ODR o, Z_PrivateCapabilities **p, int opt, const char *name)
1214 {
1215 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1216 		return odr_missing(o, opt, name) && odr_ok (o);
1217 	return
1218 		odr_implicit_settag(o, ODR_CONTEXT, 0) &&
1219 		(odr_sequence_of(o, (Odr_fun) z_PrivateCapOperator, &(*p)->operators,
1220 		  &(*p)->num_operators, "operators") || odr_ok(o)) &&
1221 		odr_implicit_settag(o, ODR_CONTEXT, 1) &&
1222 		(odr_sequence_of(o, (Odr_fun) z_SearchKey, &(*p)->searchKeys,
1223 		  &(*p)->num_searchKeys, "searchKeys") || odr_ok(o)) &&
1224 		odr_implicit_settag(o, ODR_CONTEXT, 2) &&
1225 		(odr_sequence_of(o, (Odr_fun) z_HumanString, &(*p)->description,
1226 		  &(*p)->num_description, "description") || odr_ok(o)) &&
1227 		odr_sequence_end(o);
1228 }
1229 
z_RpnCapabilities(ODR o,Z_RpnCapabilities ** p,int opt,const char * name)1230 int z_RpnCapabilities(ODR o, Z_RpnCapabilities **p, int opt, const char *name)
1231 {
1232 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1233 		return odr_missing(o, opt, name) && odr_ok (o);
1234 	return
1235 		odr_implicit_settag(o, ODR_CONTEXT, 0) &&
1236 		(odr_sequence_of(o, (Odr_fun) odr_integer, &(*p)->operators,
1237 		  &(*p)->num_operators, "operators") || odr_ok(o)) &&
1238 		odr_implicit_tag(o, odr_bool,
1239 			&(*p)->resultSetAsOperandSupported, ODR_CONTEXT, 1, 0, "resultSetAsOperandSupported") &&
1240 		odr_implicit_tag(o, odr_bool,
1241 			&(*p)->restrictionOperandSupported, ODR_CONTEXT, 2, 0, "restrictionOperandSupported") &&
1242 		odr_implicit_tag(o, z_ProximitySupport,
1243 			&(*p)->proximity, ODR_CONTEXT, 3, 1, "proximity") &&
1244 		odr_sequence_end(o);
1245 }
1246 
z_Iso8777Capabilities(ODR o,Z_Iso8777Capabilities ** p,int opt,const char * name)1247 int z_Iso8777Capabilities(ODR o, Z_Iso8777Capabilities **p, int opt, const char *name)
1248 {
1249 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1250 		return odr_missing(o, opt, name) && odr_ok (o);
1251 	return
1252 		odr_implicit_settag(o, ODR_CONTEXT, 0) &&
1253 		odr_sequence_of(o, (Odr_fun) z_SearchKey, &(*p)->searchKeys,
1254 		  &(*p)->num_searchKeys, "searchKeys") &&
1255 		odr_implicit_tag(o, z_HumanString,
1256 			&(*p)->restrictions, ODR_CONTEXT, 1, 1, "restrictions") &&
1257 		odr_sequence_end(o);
1258 }
1259 
z_ProxSupportPrivate(ODR o,Z_ProxSupportPrivate ** p,int opt,const char * name)1260 int z_ProxSupportPrivate(ODR o, Z_ProxSupportPrivate **p, int opt, const char *name)
1261 {
1262 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1263 		return odr_missing(o, opt, name) && odr_ok (o);
1264 	return
1265 		odr_implicit_tag(o, odr_integer,
1266 			&(*p)->unit, ODR_CONTEXT, 0, 0, "unit") &&
1267 		odr_explicit_tag(o, z_HumanString,
1268 			&(*p)->description, ODR_CONTEXT, 1, 1, "description") &&
1269 		odr_sequence_end(o);
1270 }
1271 
z_ProxSupportUnit(ODR o,Z_ProxSupportUnit ** p,int opt,const char * name)1272 int z_ProxSupportUnit(ODR o, Z_ProxSupportUnit **p, int opt, const char *name)
1273 {
1274 	static Odr_arm arm[] = {
1275 		{ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ProxSupportUnit_known,
1276 		(Odr_fun) odr_integer, "known"},
1277 		{ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ProxSupportUnit_private,
1278 		(Odr_fun) z_ProxSupportPrivate, "zprivate"},
1279 		{-1, -1, -1, -1, (Odr_fun) 0, 0}
1280 	};
1281 	if (!odr_initmember(o, p, sizeof(**p)))
1282 		return odr_missing(o, opt, name);
1283 	if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
1284 		return 1;
1285 	if (o->direction == ODR_DECODE)
1286 		*p = 0;
1287 	return odr_missing(o, opt, name);
1288 }
1289 
z_ProximitySupport(ODR o,Z_ProximitySupport ** p,int opt,const char * name)1290 int z_ProximitySupport(ODR o, Z_ProximitySupport **p, int opt, const char *name)
1291 {
1292 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1293 		return odr_missing(o, opt, name) && odr_ok (o);
1294 	return
1295 		odr_implicit_tag(o, odr_bool,
1296 			&(*p)->anySupport, ODR_CONTEXT, 0, 0, "anySupport") &&
1297 		odr_implicit_settag(o, ODR_CONTEXT, 1) &&
1298 		(odr_sequence_of(o, (Odr_fun) z_ProxSupportUnit, &(*p)->unitsSupported,
1299 		  &(*p)->num_unitsSupported, "unitsSupported") || odr_ok(o)) &&
1300 		odr_sequence_end(o);
1301 }
1302 
z_SearchKey(ODR o,Z_SearchKey ** p,int opt,const char * name)1303 int z_SearchKey(ODR o, Z_SearchKey **p, int opt, const char *name)
1304 {
1305 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1306 		return odr_missing(o, opt, name) && odr_ok (o);
1307 	return
1308 		odr_implicit_tag(o, z_InternationalString,
1309 			&(*p)->searchKey, ODR_CONTEXT, 0, 0, "searchKey") &&
1310 		odr_implicit_tag(o, z_HumanString,
1311 			&(*p)->description, ODR_CONTEXT, 1, 1, "description") &&
1312 		odr_sequence_end(o);
1313 }
1314 
z_AccessRestrictionsUnit(ODR o,Z_AccessRestrictionsUnit ** p,int opt,const char * name)1315 int z_AccessRestrictionsUnit(ODR o, Z_AccessRestrictionsUnit **p, int opt, const char *name)
1316 {
1317 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1318 		return odr_missing(o, opt, name) && odr_ok (o);
1319 	return
1320 		odr_explicit_tag(o, odr_integer,
1321 			&(*p)->accessType, ODR_CONTEXT, 0, 0, "accessType") &&
1322 		odr_implicit_tag(o, z_HumanString,
1323 			&(*p)->accessText, ODR_CONTEXT, 1, 1, "accessText") &&
1324 		odr_implicit_settag(o, ODR_CONTEXT, 2) &&
1325 		(odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->accessChallenges,
1326 		  &(*p)->num_accessChallenges, "accessChallenges") || odr_ok(o)) &&
1327 		odr_sequence_end(o);
1328 }
1329 
z_AccessRestrictions(ODR o,Z_AccessRestrictions ** p,int opt,const char * name)1330 int z_AccessRestrictions(ODR o, Z_AccessRestrictions **p, int opt, const char *name)
1331 {
1332 	if (!odr_initmember(o, p, sizeof(**p)))
1333 		return odr_missing(o, opt, name);
1334 	if (odr_sequence_of(o, (Odr_fun) z_AccessRestrictionsUnit, &(*p)->elements,
1335 		&(*p)->num, name))
1336 		return 1;
1337 	if (o->direction == ODR_DECODE)
1338 		*p = 0;
1339 	return odr_missing(o, opt, name);
1340 }
1341 
z_CostsOtherCharge(ODR o,Z_CostsOtherCharge ** p,int opt,const char * name)1342 int z_CostsOtherCharge(ODR o, Z_CostsOtherCharge **p, int opt, const char *name)
1343 {
1344 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1345 		return odr_missing(o, opt, name) && odr_ok (o);
1346 	return
1347 		odr_implicit_tag(o, z_HumanString,
1348 			&(*p)->forWhat, ODR_CONTEXT, 1, 0, "forWhat") &&
1349 		odr_implicit_tag(o, z_Charge,
1350 			&(*p)->charge, ODR_CONTEXT, 2, 0, "charge") &&
1351 		odr_sequence_end(o);
1352 }
1353 
z_Costs(ODR o,Z_Costs ** p,int opt,const char * name)1354 int z_Costs(ODR o, Z_Costs **p, int opt, const char *name)
1355 {
1356 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1357 		return odr_missing(o, opt, name) && odr_ok (o);
1358 	return
1359 		odr_implicit_tag(o, z_Charge,
1360 			&(*p)->connectCharge, ODR_CONTEXT, 0, 1, "connectCharge") &&
1361 		odr_implicit_tag(o, z_Charge,
1362 			&(*p)->connectTime, ODR_CONTEXT, 1, 1, "connectTime") &&
1363 		odr_implicit_tag(o, z_Charge,
1364 			&(*p)->displayCharge, ODR_CONTEXT, 2, 1, "displayCharge") &&
1365 		odr_implicit_tag(o, z_Charge,
1366 			&(*p)->searchCharge, ODR_CONTEXT, 3, 1, "searchCharge") &&
1367 		odr_implicit_tag(o, z_Charge,
1368 			&(*p)->subscriptCharge, ODR_CONTEXT, 4, 1, "subscriptCharge") &&
1369 		odr_implicit_settag(o, ODR_CONTEXT, 5) &&
1370 		(odr_sequence_of(o, (Odr_fun) z_CostsOtherCharge, &(*p)->otherCharges,
1371 		  &(*p)->num_otherCharges, "otherCharges") || odr_ok(o)) &&
1372 		odr_sequence_end(o);
1373 }
1374 
z_Charge(ODR o,Z_Charge ** p,int opt,const char * name)1375 int z_Charge(ODR o, Z_Charge **p, int opt, const char *name)
1376 {
1377 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1378 		return odr_missing(o, opt, name) && odr_ok (o);
1379 	return
1380 		odr_implicit_tag(o, z_IntUnit,
1381 			&(*p)->cost, ODR_CONTEXT, 1, 0, "cost") &&
1382 		odr_implicit_tag(o, z_Unit,
1383 			&(*p)->perWhat, ODR_CONTEXT, 2, 1, "perWhat") &&
1384 		odr_implicit_tag(o, z_HumanString,
1385 			&(*p)->text, ODR_CONTEXT, 3, 1, "text") &&
1386 		odr_sequence_end(o);
1387 }
1388 
z_DatabaseList(ODR o,Z_DatabaseList ** p,int opt,const char * name)1389 int z_DatabaseList(ODR o, Z_DatabaseList **p, int opt, const char *name)
1390 {
1391 	if (!odr_initmember(o, p, sizeof(**p)))
1392 		return odr_missing(o, opt, name);
1393 	if (odr_sequence_of(o, (Odr_fun) z_DatabaseName, &(*p)->databases,
1394 		&(*p)->num_databases, name))
1395 		return 1;
1396 	if (o->direction == ODR_DECODE)
1397 		*p = 0;
1398 	return odr_missing(o, opt, name);
1399 }
1400 
z_AttributeCombinations(ODR o,Z_AttributeCombinations ** p,int opt,const char * name)1401 int z_AttributeCombinations(ODR o, Z_AttributeCombinations **p, int opt, const char *name)
1402 {
1403 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1404 		return odr_missing(o, opt, name) && odr_ok (o);
1405 	return
1406 		odr_implicit_tag(o, z_AttributeSetId,
1407 			&(*p)->defaultAttributeSet, ODR_CONTEXT, 0, 0, "defaultAttributeSet") &&
1408 		odr_implicit_settag(o, ODR_CONTEXT, 1) &&
1409 		odr_sequence_of(o, (Odr_fun) z_AttributeCombination, &(*p)->legalCombinations,
1410 		  &(*p)->num_legalCombinations, "legalCombinations") &&
1411 		odr_sequence_end(o);
1412 }
1413 
z_AttributeCombination(ODR o,Z_AttributeCombination ** p,int opt,const char * name)1414 int z_AttributeCombination(ODR o, Z_AttributeCombination **p, int opt, const char *name)
1415 {
1416 	if (!odr_initmember(o, p, sizeof(**p)))
1417 		return odr_missing(o, opt, name);
1418 	if (odr_sequence_of(o, (Odr_fun) z_AttributeOccurrence, &(*p)->occurrences,
1419 		&(*p)->num_occurrences, name))
1420 		return 1;
1421 	if (o->direction == ODR_DECODE)
1422 		*p = 0;
1423 	return odr_missing(o, opt, name);
1424 }
1425 
z_AttributeValueList(ODR o,Z_AttributeValueList ** p,int opt,const char * name)1426 int z_AttributeValueList(ODR o, Z_AttributeValueList **p, int opt, const char *name)
1427 {
1428 	if (!odr_initmember(o, p, sizeof(**p)))
1429 		return odr_missing(o, opt, name);
1430 	if (odr_sequence_of(o, (Odr_fun) z_StringOrNumeric, &(*p)->attributes,
1431 		&(*p)->num_attributes, name))
1432 		return 1;
1433 	if (o->direction == ODR_DECODE)
1434 		*p = 0;
1435 	return odr_missing(o, opt, name);
1436 }
1437 
z_AttributeOccurrence(ODR o,Z_AttributeOccurrence ** p,int opt,const char * name)1438 int z_AttributeOccurrence(ODR o, Z_AttributeOccurrence **p, int opt, const char *name)
1439 {
1440 	static Odr_arm arm[] = {
1441 		{ODR_IMPLICIT, ODR_CONTEXT, 3, Z_AttributeOcc_any_or_none,
1442 		(Odr_fun) odr_null, "any_or_none"},
1443 		{ODR_IMPLICIT, ODR_CONTEXT, 4, Z_AttributeOcc_specific,
1444 		(Odr_fun) z_AttributeValueList, "specific"},
1445 		{-1, -1, -1, -1, (Odr_fun) 0, 0}
1446 	};
1447 	if (!odr_sequence_begin(o, p, sizeof(**p), name))
1448 		return odr_missing(o, opt, name) && odr_ok (o);
1449 	return
1450 		odr_implicit_tag(o, z_AttributeSetId,
1451 			&(*p)->attributeSet, ODR_CONTEXT, 0, 1, "attributeSet") &&
1452 		odr_implicit_tag(o, odr_integer,
1453 			&(*p)->attributeType, ODR_CONTEXT, 1, 0, "attributeType") &&
1454 		odr_implicit_tag(o, odr_null,
1455 			&(*p)->mustBeSupplied, ODR_CONTEXT, 2, 1, "mustBeSupplied") &&
1456 		odr_choice(o, arm, &(*p)->attributeValues, &(*p)->which, 0) &&
1457 		odr_sequence_end(o);
1458 }
1459