Avoid redundant YAZ includes.
[yaz4j-moved-to-github.git] / dependencies / yaz-2.1.28 / src / z-core.c
1 /** \file z-core.c
2     \brief ASN.1 Module Z39-50-APDU-1995
3
4     Generated automatically by YAZ ASN.1 Compiler 0.4
5 */
6
7 #include <yaz/z-core.h>
8
9 int z_APDU (ODR o, Z_APDU **p, int opt, const char *name)
10 {
11         static Odr_arm arm[] = {
12                 {ODR_IMPLICIT, ODR_CONTEXT, 20, Z_APDU_initRequest,
13                 (Odr_fun) z_InitRequest, "initRequest"},
14                 {ODR_IMPLICIT, ODR_CONTEXT, 21, Z_APDU_initResponse,
15                 (Odr_fun) z_InitResponse, "initResponse"},
16                 {ODR_IMPLICIT, ODR_CONTEXT, 22, Z_APDU_searchRequest,
17                 (Odr_fun) z_SearchRequest, "searchRequest"},
18                 {ODR_IMPLICIT, ODR_CONTEXT, 23, Z_APDU_searchResponse,
19                 (Odr_fun) z_SearchResponse, "searchResponse"},
20                 {ODR_IMPLICIT, ODR_CONTEXT, 24, Z_APDU_presentRequest,
21                 (Odr_fun) z_PresentRequest, "presentRequest"},
22                 {ODR_IMPLICIT, ODR_CONTEXT, 25, Z_APDU_presentResponse,
23                 (Odr_fun) z_PresentResponse, "presentResponse"},
24                 {ODR_IMPLICIT, ODR_CONTEXT, 26, Z_APDU_deleteResultSetRequest,
25                 (Odr_fun) z_DeleteResultSetRequest, "deleteResultSetRequest"},
26                 {ODR_IMPLICIT, ODR_CONTEXT, 27, Z_APDU_deleteResultSetResponse,
27                 (Odr_fun) z_DeleteResultSetResponse, "deleteResultSetResponse"},
28                 {ODR_IMPLICIT, ODR_CONTEXT, 28, Z_APDU_accessControlRequest,
29                 (Odr_fun) z_AccessControlRequest, "accessControlRequest"},
30                 {ODR_IMPLICIT, ODR_CONTEXT, 29, Z_APDU_accessControlResponse,
31                 (Odr_fun) z_AccessControlResponse, "accessControlResponse"},
32                 {ODR_IMPLICIT, ODR_CONTEXT, 30, Z_APDU_resourceControlRequest,
33                 (Odr_fun) z_ResourceControlRequest, "resourceControlRequest"},
34                 {ODR_IMPLICIT, ODR_CONTEXT, 31, Z_APDU_resourceControlResponse,
35                 (Odr_fun) z_ResourceControlResponse, "resourceControlResponse"},
36                 {ODR_IMPLICIT, ODR_CONTEXT, 32, Z_APDU_triggerResourceControlRequest,
37                 (Odr_fun) z_TriggerResourceControlRequest, "triggerResourceControlRequest"},
38                 {ODR_IMPLICIT, ODR_CONTEXT, 33, Z_APDU_resourceReportRequest,
39                 (Odr_fun) z_ResourceReportRequest, "resourceReportRequest"},
40                 {ODR_IMPLICIT, ODR_CONTEXT, 34, Z_APDU_resourceReportResponse,
41                 (Odr_fun) z_ResourceReportResponse, "resourceReportResponse"},
42                 {ODR_IMPLICIT, ODR_CONTEXT, 35, Z_APDU_scanRequest,
43                 (Odr_fun) z_ScanRequest, "scanRequest"},
44                 {ODR_IMPLICIT, ODR_CONTEXT, 36, Z_APDU_scanResponse,
45                 (Odr_fun) z_ScanResponse, "scanResponse"},
46                 {ODR_IMPLICIT, ODR_CONTEXT, 43, Z_APDU_sortRequest,
47                 (Odr_fun) z_SortRequest, "sortRequest"},
48                 {ODR_IMPLICIT, ODR_CONTEXT, 44, Z_APDU_sortResponse,
49                 (Odr_fun) z_SortResponse, "sortResponse"},
50                 {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_APDU_segmentRequest,
51                 (Odr_fun) z_Segment, "segmentRequest"},
52                 {ODR_IMPLICIT, ODR_CONTEXT, 46, Z_APDU_extendedServicesRequest,
53                 (Odr_fun) z_ExtendedServicesRequest, "extendedServicesRequest"},
54                 {ODR_IMPLICIT, ODR_CONTEXT, 47, Z_APDU_extendedServicesResponse,
55                 (Odr_fun) z_ExtendedServicesResponse, "extendedServicesResponse"},
56                 {ODR_IMPLICIT, ODR_CONTEXT, 48, Z_APDU_close,
57                 (Odr_fun) z_Close, "close"},
58                 {ODR_IMPLICIT, ODR_CONTEXT, 49, Z_APDU_duplicateDetectionRequest,
59                 (Odr_fun) z_DuplicateDetectionRequest, "duplicateDetectionRequest"},
60                 {ODR_IMPLICIT, ODR_CONTEXT, 50, Z_APDU_duplicateDetectionResponse,
61                 (Odr_fun) z_DuplicateDetectionResponse, "duplicateDetectionResponse"},
62                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
63         };
64         if (!odr_initmember(o, p, sizeof(**p)))
65                 return odr_missing(o, opt, name);
66         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
67                 return 1;
68         if(o->direction == ODR_DECODE)
69                 *p = 0;
70         return odr_missing(o, opt, name);
71 }
72
73 int z_InitRequest (ODR o, Z_InitRequest **p, int opt, const char *name)
74 {
75         if (!odr_sequence_begin (o, p, sizeof(**p), name))
76                 return odr_missing(o, opt, name) && odr_ok (o);
77         return
78                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
79                 z_ProtocolVersion(o, &(*p)->protocolVersion, 0, "protocolVersion") &&
80                 z_Options(o, &(*p)->options, 0, "options") &&
81                 odr_implicit_tag (o, odr_integer,
82                         &(*p)->preferredMessageSize, ODR_CONTEXT, 5, 0, "preferredMessageSize") &&
83                 odr_implicit_tag (o, odr_integer,
84                         &(*p)->maximumRecordSize, ODR_CONTEXT, 6, 0, "maximumRecordSize") &&
85                 odr_explicit_tag (o, z_IdAuthentication,
86                         &(*p)->idAuthentication, ODR_CONTEXT, 7, 1, "idAuthentication") &&
87                 odr_implicit_tag (o, z_InternationalString,
88                         &(*p)->implementationId, ODR_CONTEXT, 110, 1, "implementationId") &&
89                 odr_implicit_tag (o, z_InternationalString,
90                         &(*p)->implementationName, ODR_CONTEXT, 111, 1, "implementationName") &&
91                 odr_implicit_tag (o, z_InternationalString,
92                         &(*p)->implementationVersion, ODR_CONTEXT, 112, 1, "implementationVersion") &&
93                 odr_explicit_tag (o, z_External,
94                         &(*p)->userInformationField, ODR_CONTEXT, 11, 1, "userInformationField") &&
95                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
96                 odr_sequence_end (o);
97 }
98
99 int z_IdPass (ODR o, Z_IdPass **p, int opt, const char *name)
100 {
101         if (!odr_sequence_begin (o, p, sizeof(**p), name))
102                 return odr_missing(o, opt, name) && odr_ok (o);
103         return
104                 odr_implicit_tag (o, z_InternationalString,
105                         &(*p)->groupId, ODR_CONTEXT, 0, 1, "groupId") &&
106                 odr_implicit_tag (o, z_InternationalString,
107                         &(*p)->userId, ODR_CONTEXT, 1, 1, "userId") &&
108                 odr_implicit_tag (o, z_InternationalString,
109                         &(*p)->password, ODR_CONTEXT, 2, 1, "password") &&
110                 odr_sequence_end (o);
111 }
112
113 int z_IdAuthentication (ODR o, Z_IdAuthentication **p, int opt, const char *name)
114 {
115         static Odr_arm arm[] = {
116                 {-1, -1, -1, Z_IdAuthentication_open,
117                  (Odr_fun) odr_visiblestring, "open"},
118                 {-1, -1, -1, Z_IdAuthentication_idPass,
119                  (Odr_fun) z_IdPass, "idPass"},
120                 {-1, -1, -1, Z_IdAuthentication_anonymous,
121                  (Odr_fun) odr_null, "anonymous"},
122                 {-1, -1, -1, Z_IdAuthentication_other,
123                  (Odr_fun) z_External, "other"},
124                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
125         };
126         if (!odr_initmember(o, p, sizeof(**p)))
127                 return odr_missing(o, opt, name);
128         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
129                 return 1;
130         if(o->direction == ODR_DECODE)
131                 *p = 0;
132         return odr_missing(o, opt, name);
133 }
134
135 int z_InitResponse (ODR o, Z_InitResponse **p, int opt, const char *name)
136 {
137         if (!odr_sequence_begin (o, p, sizeof(**p), name))
138                 return odr_missing(o, opt, name) && odr_ok (o);
139         return
140                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
141                 z_ProtocolVersion(o, &(*p)->protocolVersion, 0, "protocolVersion") &&
142                 z_Options(o, &(*p)->options, 0, "options") &&
143                 odr_implicit_tag (o, odr_integer,
144                         &(*p)->preferredMessageSize, ODR_CONTEXT, 5, 0, "preferredMessageSize") &&
145                 odr_implicit_tag (o, odr_integer,
146                         &(*p)->maximumRecordSize, ODR_CONTEXT, 6, 0, "maximumRecordSize") &&
147                 odr_implicit_tag (o, odr_bool,
148                         &(*p)->result, ODR_CONTEXT, 12, 0, "result") &&
149                 odr_implicit_tag (o, z_InternationalString,
150                         &(*p)->implementationId, ODR_CONTEXT, 110, 1, "implementationId") &&
151                 odr_implicit_tag (o, z_InternationalString,
152                         &(*p)->implementationName, ODR_CONTEXT, 111, 1, "implementationName") &&
153                 odr_implicit_tag (o, z_InternationalString,
154                         &(*p)->implementationVersion, ODR_CONTEXT, 112, 1, "implementationVersion") &&
155                 odr_explicit_tag (o, z_External,
156                         &(*p)->userInformationField, ODR_CONTEXT, 11, 1, "userInformationField") &&
157                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
158                 odr_sequence_end (o);
159 }
160
161 int z_ProtocolVersion (ODR o, Z_ProtocolVersion **p, int opt, const char *name)
162 {
163         return odr_implicit_tag (o, odr_bitstring, p, ODR_CONTEXT, 3, opt, name);
164 }
165
166 int z_Options (ODR o, Z_Options **p, int opt, const char *name)
167 {
168         return odr_implicit_tag (o, odr_bitstring, p, ODR_CONTEXT, 4, opt, name);
169 }
170
171 int z_SearchRequest (ODR o, Z_SearchRequest **p, int opt, const char *name)
172 {
173         if (!odr_sequence_begin (o, p, sizeof(**p), name))
174                 return odr_missing(o, opt, name) && odr_ok (o);
175         return
176                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
177                 odr_implicit_tag (o, odr_integer,
178                         &(*p)->smallSetUpperBound, ODR_CONTEXT, 13, 0, "smallSetUpperBound") &&
179                 odr_implicit_tag (o, odr_integer,
180                         &(*p)->largeSetLowerBound, ODR_CONTEXT, 14, 0, "largeSetLowerBound") &&
181                 odr_implicit_tag (o, odr_integer,
182                         &(*p)->mediumSetPresentNumber, ODR_CONTEXT, 15, 0, "mediumSetPresentNumber") &&
183                 odr_implicit_tag (o, odr_bool,
184                         &(*p)->replaceIndicator, ODR_CONTEXT, 16, 0, "replaceIndicator") &&
185                 odr_implicit_tag (o, z_InternationalString,
186                         &(*p)->resultSetName, ODR_CONTEXT, 17, 0, "resultSetName") &&
187                 odr_implicit_settag (o, ODR_CONTEXT, 18) &&
188                 odr_sequence_of(o, (Odr_fun) z_DatabaseName, &(*p)->databaseNames,
189                   &(*p)->num_databaseNames, "databaseNames") &&
190                 odr_explicit_tag (o, z_ElementSetNames,
191                         &(*p)->smallSetElementSetNames, ODR_CONTEXT, 100, 1, "smallSetElementSetNames") &&
192                 odr_explicit_tag (o, z_ElementSetNames,
193                         &(*p)->mediumSetElementSetNames, ODR_CONTEXT, 101, 1, "mediumSetElementSetNames") &&
194                 odr_implicit_tag (o, odr_oid,
195                         &(*p)->preferredRecordSyntax, ODR_CONTEXT, 104, 1, "preferredRecordSyntax") &&
196                 odr_explicit_tag (o, z_Query,
197                         &(*p)->query, ODR_CONTEXT, 21, 0, "query") &&
198                 odr_implicit_tag (o, z_OtherInformation,
199                         &(*p)->additionalSearchInfo, ODR_CONTEXT, 203, 1, "additionalSearchInfo") &&
200                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
201                 odr_sequence_end (o);
202 }
203
204 int z_Query (ODR o, Z_Query **p, int opt, const char *name)
205 {
206         static Odr_arm arm[] = {
207                 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_Query_type_0,
208                 (Odr_fun) z_ANY_type_0, "type_0"},
209                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Query_type_1,
210                 (Odr_fun) z_RPNQuery, "type_1"},
211                 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Query_type_2,
212                 (Odr_fun) odr_octetstring, "type_2"},
213                 {ODR_EXPLICIT, ODR_CONTEXT, 100, Z_Query_type_100,
214                 (Odr_fun) odr_octetstring, "type_100"},
215                 {ODR_IMPLICIT, ODR_CONTEXT, 101, Z_Query_type_101,
216                 (Odr_fun) z_RPNQuery, "type_101"},
217                 {ODR_EXPLICIT, ODR_CONTEXT, 102, Z_Query_type_102,
218                 (Odr_fun) odr_octetstring, "type_102"},
219                 {ODR_IMPLICIT, ODR_CONTEXT, 104, Z_Query_type_104,
220                 (Odr_fun) z_External, "type_104"},
221                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
222         };
223         if (!odr_initmember(o, p, sizeof(**p)))
224                 return odr_missing(o, opt, name);
225         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
226                 return 1;
227         if(o->direction == ODR_DECODE)
228                 *p = 0;
229         return odr_missing(o, opt, name);
230 }
231
232 int z_RPNQuery (ODR o, Z_RPNQuery **p, int opt, const char *name)
233 {
234         if (!odr_sequence_begin (o, p, sizeof(**p), name))
235                 return odr_missing(o, opt, name) && odr_ok (o);
236         return
237                 z_AttributeSetId(o, &(*p)->attributeSetId, 0, "attributeSetId") &&
238                 z_RPNStructure(o, &(*p)->RPNStructure, 0, "RPNStructure") &&
239                 odr_sequence_end (o);
240 }
241
242 int z_Complex (ODR o, Z_Complex **p, int opt, const char *name)
243 {
244         if (!odr_sequence_begin (o, p, sizeof(**p), name))
245                 return odr_missing(o, opt, name) && odr_ok (o);
246         return
247                 z_RPNStructure(o, &(*p)->s1, 0, "s1") &&
248                 z_RPNStructure(o, &(*p)->s2, 0, "s2") &&
249                 z_Operator(o, &(*p)->roperator, 0, "roperator") &&
250                 odr_sequence_end (o);
251 }
252
253 int z_RPNStructure (ODR o, Z_RPNStructure **p, int opt, const char *name)
254 {
255         static Odr_arm arm[] = {
256                 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_RPNStructure_simple,
257                 (Odr_fun) z_Operand, "simple"},
258                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_RPNStructure_complex,
259                 (Odr_fun) z_Complex, "complex"},
260                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
261         };
262         if (!odr_initmember(o, p, sizeof(**p)))
263                 return odr_missing(o, opt, name);
264         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
265                 return 1;
266         if(o->direction == ODR_DECODE)
267                 *p = 0;
268         return odr_missing(o, opt, name);
269 }
270
271 int z_Operand (ODR o, Z_Operand **p, int opt, const char *name)
272 {
273         static Odr_arm arm[] = {
274                 {-1, -1, -1, Z_Operand_APT,
275                  (Odr_fun) z_AttributesPlusTerm, "attributesPlusTerm"},
276                 {-1, -1, -1, Z_Operand_resultSetId,
277                  (Odr_fun) z_ResultSetId, "resultSetId"},
278                 {-1, -1, -1, Z_Operand_resultAttr,
279                  (Odr_fun) z_ResultSetPlusAttributes, "resultAttr"},
280                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
281         };
282         if (!odr_initmember(o, p, sizeof(**p)))
283                 return odr_missing(o, opt, name);
284         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
285                 return 1;
286         if(o->direction == ODR_DECODE)
287                 *p = 0;
288         return odr_missing(o, opt, name);
289 }
290
291 int z_AttributesPlusTerm (ODR o, Z_AttributesPlusTerm **p, int opt, const char *name)
292 {
293         if (!odr_implicit_settag (o, ODR_CONTEXT, 102) ||
294                 !odr_sequence_begin (o, p, sizeof(**p), name))
295                 return odr_missing(o, opt, name);
296         return
297                 z_AttributeList(o, &(*p)->attributes, 0, "attributes") &&
298                 z_Term(o, &(*p)->term, 0, "term") &&
299                 odr_sequence_end (o);
300 }
301
302 int z_ResultSetPlusAttributes (ODR o, Z_ResultSetPlusAttributes **p, int opt, const char *name)
303 {
304         if (!odr_implicit_settag (o, ODR_CONTEXT, 214) ||
305                 !odr_sequence_begin (o, p, sizeof(**p), name))
306                 return odr_missing(o, opt, name);
307         return
308                 z_ResultSetId(o, &(*p)->resultSet, 0, "resultSet") &&
309                 z_AttributeList(o, &(*p)->attributes, 0, "attributes") &&
310                 odr_sequence_end (o);
311 }
312
313 int z_AttributeList (ODR o, Z_AttributeList **p, int opt, const char *name)
314 {
315         if (!odr_initmember (o, p, sizeof(**p)))
316                 return odr_missing(o, opt, name);
317         odr_implicit_settag (o, ODR_CONTEXT, 44);
318         if (odr_sequence_of (o, (Odr_fun) z_AttributeElement, &(*p)->attributes,
319                 &(*p)->num_attributes, name))
320                 return 1;
321         if(o->direction == ODR_DECODE)
322                 *p = 0;
323         return odr_missing(o, opt, name);
324 }
325
326 int z_Term (ODR o, Z_Term **p, int opt, const char *name)
327 {
328         static Odr_arm arm[] = {
329                 {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_Term_general,
330                 (Odr_fun) odr_octetstring, "general"},
331                 {ODR_IMPLICIT, ODR_CONTEXT, 215, Z_Term_numeric,
332                 (Odr_fun) odr_integer, "numeric"},
333                 {ODR_IMPLICIT, ODR_CONTEXT, 216, Z_Term_characterString,
334                 (Odr_fun) z_InternationalString, "characterString"},
335                 {ODR_IMPLICIT, ODR_CONTEXT, 217, Z_Term_oid,
336                 (Odr_fun) odr_oid, "oid"},
337                 {ODR_IMPLICIT, ODR_CONTEXT, 218, Z_Term_dateTime,
338                 (Odr_fun) odr_generalizedtime, "dateTime"},
339                 {ODR_IMPLICIT, ODR_CONTEXT, 219, Z_Term_external,
340                 (Odr_fun) z_External, "external"},
341                 {ODR_IMPLICIT, ODR_CONTEXT, 220, Z_Term_integerAndUnit,
342                 (Odr_fun) z_IntUnit, "integerAndUnit"},
343                 {ODR_IMPLICIT, ODR_CONTEXT, 221, Z_Term_null,
344                 (Odr_fun) odr_null, "null"},
345                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
346         };
347         if (!odr_initmember(o, p, sizeof(**p)))
348                 return odr_missing(o, opt, name);
349         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
350                 return 1;
351         if(o->direction == ODR_DECODE)
352                 *p = 0;
353         return odr_missing(o, opt, name);
354 }
355
356 int z_Operator (ODR o, Z_Operator **p, int opt, const char *name)
357 {
358         static Odr_arm arm[] = {
359                 {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Operator_and,
360                 (Odr_fun) odr_null, "op_and"},
361                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Operator_or,
362                 (Odr_fun) odr_null, "op_or"},
363                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Operator_and_not,
364                 (Odr_fun) odr_null, "and_not"},
365                 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Operator_prox,
366                 (Odr_fun) z_ProximityOperator, "prox"},
367                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
368         };
369         if (!odr_constructed_begin(o, p, ODR_CONTEXT, 46, 0))
370                 return odr_missing(o, opt, name);
371         if (!odr_initmember(o, p, sizeof(**p)))
372                 return odr_missing(o, opt, name);
373         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name) &&
374                 odr_constructed_end(o))
375                 return 1;
376         if(o->direction == ODR_DECODE)
377                 *p = 0;
378         return odr_missing(o, opt, name);
379 }
380
381 int z_ComplexAttribute (ODR o, Z_ComplexAttribute **p, int opt, const char *name)
382 {
383         if (!odr_sequence_begin (o, p, sizeof(**p), name))
384                 return odr_missing(o, opt, name) && odr_ok (o);
385         return
386                 odr_implicit_settag (o, ODR_CONTEXT, 1) &&
387                 odr_sequence_of(o, (Odr_fun) z_StringOrNumeric, &(*p)->list,
388                   &(*p)->num_list, "list") &&
389                 odr_implicit_settag (o, ODR_CONTEXT, 2) &&
390                 (odr_sequence_of(o, (Odr_fun) odr_integer, &(*p)->semanticAction,
391                   &(*p)->num_semanticAction, "semanticAction") || odr_ok(o)) &&
392                 odr_sequence_end (o);
393 }
394
395 int z_AttributeElement (ODR o, Z_AttributeElement **p, int opt, const char *name)
396 {
397         static Odr_arm arm[] = {
398                 {ODR_IMPLICIT, ODR_CONTEXT, 121, Z_AttributeValue_numeric,
399                 (Odr_fun) odr_integer, "numeric"},
400                 {ODR_IMPLICIT, ODR_CONTEXT, 224, Z_AttributeValue_complex,
401                 (Odr_fun) z_ComplexAttribute, "complex"},
402                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
403         };
404         if (!odr_sequence_begin (o, p, sizeof(**p), name))
405                 return odr_missing(o, opt, name) && odr_ok (o);
406         return
407                 odr_implicit_tag (o, z_AttributeSetId,
408                         &(*p)->attributeSet, ODR_CONTEXT, 1, 1, "attributeSet") &&
409                 odr_implicit_tag (o, odr_integer,
410                         &(*p)->attributeType, ODR_CONTEXT, 120, 0, "attributeType") &&
411                 odr_choice (o, arm, &(*p)->value, &(*p)->which, 0) &&
412                 odr_sequence_end (o);
413 }
414
415 int z_ProximityOperator (ODR o, Z_ProximityOperator **p, int opt, const char *name)
416 {
417         static Odr_arm arm[] = {
418                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ProximityOperator_known,
419                 (Odr_fun) z_ProxUnit, "known"},
420                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ProximityOperator_private,
421                 (Odr_fun) odr_integer, "zprivate"},
422                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
423         };
424         if (!odr_sequence_begin (o, p, sizeof(**p), name))
425                 return odr_missing(o, opt, name) && odr_ok (o);
426         return
427                 odr_implicit_tag (o, odr_bool,
428                         &(*p)->exclusion, ODR_CONTEXT, 1, 1, "exclusion") &&
429                 odr_implicit_tag (o, odr_integer,
430                         &(*p)->distance, ODR_CONTEXT, 2, 0, "distance") &&
431                 odr_implicit_tag (o, odr_bool,
432                         &(*p)->ordered, ODR_CONTEXT, 3, 0, "ordered") &&
433                 odr_implicit_tag (o, odr_integer,
434                         &(*p)->relationType, ODR_CONTEXT, 4, 0, "relationType") &&
435                 odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 5, "proximityUnitCode") &&
436                 odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) &&
437                 odr_constructed_end (o) &&
438                 odr_sequence_end (o);
439 }
440
441 int z_ProxUnit (ODR o, Z_ProxUnit **p, int opt, const char *name)
442 {
443         return odr_integer (o, p, opt, name);
444 }
445
446 int z_SearchResponse (ODR o, Z_SearchResponse **p, int opt, const char *name)
447 {
448         if (!odr_sequence_begin (o, p, sizeof(**p), name))
449                 return odr_missing(o, opt, name) && odr_ok (o);
450         return
451                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
452                 odr_implicit_tag (o, odr_integer,
453                         &(*p)->resultCount, ODR_CONTEXT, 23, 0, "resultCount") &&
454                 odr_implicit_tag (o, odr_integer,
455                         &(*p)->numberOfRecordsReturned, ODR_CONTEXT, 24, 0, "numberOfRecordsReturned") &&
456                 odr_implicit_tag (o, odr_integer,
457                         &(*p)->nextResultSetPosition, ODR_CONTEXT, 25, 0, "nextResultSetPosition") &&
458                 odr_implicit_tag (o, odr_bool,
459                         &(*p)->searchStatus, ODR_CONTEXT, 22, 0, "searchStatus") &&
460                 odr_implicit_tag (o, odr_integer,
461                         &(*p)->resultSetStatus, ODR_CONTEXT, 26, 1, "resultSetStatus") &&
462                 z_PresentStatus(o, &(*p)->presentStatus, 1, "presentStatus") &&
463                 z_Records(o, &(*p)->records, 1, "records") &&
464                 odr_implicit_tag (o, z_OtherInformation,
465                         &(*p)->additionalSearchInfo, ODR_CONTEXT, 203, 1, "additionalSearchInfo") &&
466                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
467                 odr_sequence_end (o);
468 }
469
470 int z_RecordComposition (ODR o, Z_RecordComposition **p, int opt, const char *name)
471 {
472         static Odr_arm arm[] = {
473                 {ODR_EXPLICIT, ODR_CONTEXT, 19, Z_RecordComp_simple,
474                 (Odr_fun) z_ElementSetNames, "simple"},
475                 {ODR_IMPLICIT, ODR_CONTEXT, 209, Z_RecordComp_complex,
476                 (Odr_fun) z_CompSpec, "complex"},
477                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
478         };
479         if (!odr_initmember(o, p, sizeof(**p)))
480                 return odr_missing(o, opt, name);
481         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
482                 return 1;
483         if(o->direction == ODR_DECODE)
484                 *p = 0;
485         return odr_missing(o, opt, name);
486 }
487
488 int z_PresentRequest (ODR o, Z_PresentRequest **p, int opt, const char *name)
489 {
490         if (!odr_sequence_begin (o, p, sizeof(**p), name))
491                 return odr_missing(o, opt, name) && odr_ok (o);
492         return
493                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
494                 z_ResultSetId(o, &(*p)->resultSetId, 0, "resultSetId") &&
495                 odr_implicit_tag (o, odr_integer,
496                         &(*p)->resultSetStartPoint, ODR_CONTEXT, 30, 0, "resultSetStartPoint") &&
497                 odr_implicit_tag (o, odr_integer,
498                         &(*p)->numberOfRecordsRequested, ODR_CONTEXT, 29, 0, "numberOfRecordsRequested") &&
499                 odr_implicit_settag (o, ODR_CONTEXT, 212) &&
500                 (odr_sequence_of(o, (Odr_fun) z_Range, &(*p)->additionalRanges,
501                   &(*p)->num_ranges, "additionalRanges") || odr_ok(o)) &&
502                 z_RecordComposition (o, &(*p)->recordComposition, 1, "recordComposition") &&
503                 odr_implicit_tag (o, odr_oid,
504                         &(*p)->preferredRecordSyntax, ODR_CONTEXT, 104, 1, "preferredRecordSyntax") &&
505                 odr_implicit_tag (o, odr_integer,
506                         &(*p)->maxSegmentCount, ODR_CONTEXT, 204, 1, "maxSegmentCount") &&
507                 odr_implicit_tag (o, odr_integer,
508                         &(*p)->maxRecordSize, ODR_CONTEXT, 206, 1, "maxRecordSize") &&
509                 odr_implicit_tag (o, odr_integer,
510                         &(*p)->maxSegmentSize, ODR_CONTEXT, 207, 1, "maxSegmentSize") &&
511                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
512                 odr_sequence_end (o);
513 }
514
515 int z_Segment (ODR o, Z_Segment **p, int opt, const char *name)
516 {
517         if (!odr_sequence_begin (o, p, sizeof(**p), name))
518                 return odr_missing(o, opt, name) && odr_ok (o);
519         return
520                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
521                 odr_implicit_tag (o, odr_integer,
522                         &(*p)->numberOfRecordsReturned, ODR_CONTEXT, 24, 0, "numberOfRecordsReturned") &&
523                 odr_implicit_settag (o, ODR_CONTEXT, 0) &&
524                 odr_sequence_of(o, (Odr_fun) z_NamePlusRecord, &(*p)->segmentRecords,
525                   &(*p)->num_segmentRecords, "segmentRecords") &&
526                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
527                 odr_sequence_end (o);
528 }
529
530 int z_PresentResponse (ODR o, Z_PresentResponse **p, int opt, const char *name)
531 {
532         if (!odr_sequence_begin (o, p, sizeof(**p), name))
533                 return odr_missing(o, opt, name) && odr_ok (o);
534         return
535                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
536                 odr_implicit_tag (o, odr_integer,
537                         &(*p)->numberOfRecordsReturned, ODR_CONTEXT, 24, 0, "numberOfRecordsReturned") &&
538                 odr_implicit_tag (o, odr_integer,
539                         &(*p)->nextResultSetPosition, ODR_CONTEXT, 25, 0, "nextResultSetPosition") &&
540                 z_PresentStatus(o, &(*p)->presentStatus, 0, "presentStatus") &&
541                 z_Records(o, &(*p)->records, 1, "records") &&
542                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
543                 odr_sequence_end (o);
544 }
545
546 int z_NamePlusRecordList (ODR o, Z_NamePlusRecordList **p, int opt, const char *name)
547 {
548         if (!odr_initmember (o, p, sizeof(**p)))
549                 return odr_missing(o, opt, name);
550         if (odr_sequence_of (o, (Odr_fun) z_NamePlusRecord, &(*p)->records,
551                 &(*p)->num_records, name))
552                 return 1;
553         if(o->direction == ODR_DECODE)
554                 *p = 0;
555         return odr_missing(o, opt, name);
556 }
557
558 int z_DiagRecs (ODR o, Z_DiagRecs **p, int opt, const char *name)
559 {
560         if (!odr_initmember (o, p, sizeof(**p)))
561                 return odr_missing(o, opt, name);
562         if (odr_sequence_of (o, (Odr_fun) z_DiagRec, &(*p)->diagRecs,
563                 &(*p)->num_diagRecs, name))
564                 return 1;
565         if(o->direction == ODR_DECODE)
566                 *p = 0;
567         return odr_missing(o, opt, name);
568 }
569
570 int z_Records (ODR o, Z_Records **p, int opt, const char *name)
571 {
572         static Odr_arm arm[] = {
573                 {ODR_IMPLICIT, ODR_CONTEXT, 28, Z_Records_DBOSD,
574                 (Odr_fun) z_NamePlusRecordList, "databaseOrSurDiagnostics"},
575                 {ODR_IMPLICIT, ODR_CONTEXT, 130, Z_Records_NSD,
576                 (Odr_fun) z_DefaultDiagFormat, "nonSurrogateDiagnostic"},
577                 {ODR_IMPLICIT, ODR_CONTEXT, 205, Z_Records_multipleNSD,
578                 (Odr_fun) z_DiagRecs, "multipleNonSurDiagnostics"},
579                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
580         };
581         if (!odr_initmember(o, p, sizeof(**p)))
582                 return odr_missing(o, opt, name);
583         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
584                 return 1;
585         if(o->direction == ODR_DECODE)
586                 *p = 0;
587         return odr_missing(o, opt, name);
588 }
589
590 int z_NamePlusRecord (ODR o, Z_NamePlusRecord **p, int opt, const char *name)
591 {
592         static Odr_arm arm[] = {
593                 {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_NamePlusRecord_databaseRecord,
594                 (Odr_fun) z_External, "databaseRecord"},
595                 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_NamePlusRecord_surrogateDiagnostic,
596                 (Odr_fun) z_DiagRec, "surrogateDiagnostic"},
597                 {ODR_EXPLICIT, ODR_CONTEXT, 3, Z_NamePlusRecord_startingFragment,
598                 (Odr_fun) z_FragmentSyntax, "startingFragment"},
599                 {ODR_EXPLICIT, ODR_CONTEXT, 4, Z_NamePlusRecord_intermediateFragment,
600                 (Odr_fun) z_FragmentSyntax, "intermediateFragment"},
601                 {ODR_EXPLICIT, ODR_CONTEXT, 5, Z_NamePlusRecord_finalFragment,
602                 (Odr_fun) z_FragmentSyntax, "finalFragment"},
603                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
604         };
605         if (!odr_sequence_begin (o, p, sizeof(**p), name))
606                 return odr_missing(o, opt, name) && odr_ok (o);
607         return
608                 odr_implicit_tag (o, z_DatabaseName,
609                         &(*p)->databaseName, ODR_CONTEXT, 0, 1, "databaseName") &&
610                 odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, "record") &&
611                 odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) &&
612                 odr_constructed_end (o) &&
613                 odr_sequence_end (o);
614 }
615
616 int z_FragmentSyntax (ODR o, Z_FragmentSyntax **p, int opt, const char *name)
617 {
618         static Odr_arm arm[] = {
619                 {-1, -1, -1, Z_FragmentSyntax_externallyTagged,
620                  (Odr_fun) z_External, "externallyTagged"},
621                 {-1, -1, -1, Z_FragmentSyntax_notExternallyTagged,
622                  (Odr_fun) odr_octetstring, "notExternallyTagged"},
623                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
624         };
625         if (!odr_initmember(o, p, sizeof(**p)))
626                 return odr_missing(o, opt, name);
627         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
628                 return 1;
629         if(o->direction == ODR_DECODE)
630                 *p = 0;
631         return odr_missing(o, opt, name);
632 }
633
634 int z_DiagRec (ODR o, Z_DiagRec **p, int opt, const char *name)
635 {
636         static Odr_arm arm[] = {
637                 {-1, -1, -1, Z_DiagRec_defaultFormat,
638                  (Odr_fun) z_DefaultDiagFormat, "defaultFormat"},
639                 {-1, -1, -1, Z_DiagRec_externallyDefined,
640                  (Odr_fun) z_External, "externallyDefined"},
641                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
642         };
643         if (!odr_initmember(o, p, sizeof(**p)))
644                 return odr_missing(o, opt, name);
645         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
646                 return 1;
647         if(o->direction == ODR_DECODE)
648                 *p = 0;
649         return odr_missing(o, opt, name);
650 }
651
652 int z_DefaultDiagFormat (ODR o, Z_DefaultDiagFormat **p, int opt, const char *name)
653 {
654         static Odr_arm arm[] = {
655                 {-1, -1, -1, Z_DefaultDiagFormat_v2Addinfo,
656                  (Odr_fun) odr_visiblestring, "v2Addinfo"},
657                 {-1, -1, -1, Z_DefaultDiagFormat_v3Addinfo,
658                  (Odr_fun) z_InternationalString, "v3Addinfo"},
659                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
660         };
661         if (!odr_sequence_begin (o, p, sizeof(**p), name))
662                 return odr_missing(o, opt, name) && odr_ok (o);
663         return
664                 odr_oid(o, &(*p)->diagnosticSetId, 0, "diagnosticSetId") &&
665                 odr_integer(o, &(*p)->condition, 0, "condition") &&
666                 odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) &&
667                 odr_sequence_end (o);
668 }
669
670 int z_Range (ODR o, Z_Range **p, int opt, const char *name)
671 {
672         if (!odr_sequence_begin (o, p, sizeof(**p), name))
673                 return odr_missing(o, opt, name) && odr_ok (o);
674         return
675                 odr_implicit_tag (o, odr_integer,
676                         &(*p)->startingPosition, ODR_CONTEXT, 1, 0, "startingPosition") &&
677                 odr_implicit_tag (o, odr_integer,
678                         &(*p)->numberOfRecords, ODR_CONTEXT, 2, 0, "numberOfRecords") &&
679                 odr_sequence_end (o);
680 }
681
682 int z_DatabaseSpecificUnit (ODR o, Z_DatabaseSpecificUnit **p, int opt, const char *name)
683 {
684         if (!odr_sequence_begin (o, p, sizeof(**p), name))
685                 return odr_missing(o, opt, name) && odr_ok (o);
686         return
687                 z_DatabaseName(o, &(*p)->dbName, 0, "dbName") &&
688                 z_ElementSetName(o, &(*p)->esn, 0, "esn") &&
689                 odr_sequence_end (o);
690 }
691
692 int z_DatabaseSpecific (ODR o, Z_DatabaseSpecific **p, int opt, const char *name)
693 {
694         if (!odr_initmember (o, p, sizeof(**p)))
695                 return odr_missing(o, opt, name);
696         if (odr_sequence_of (o, (Odr_fun) z_DatabaseSpecificUnit, &(*p)->elements,
697                 &(*p)->num, name))
698                 return 1;
699         if(o->direction == ODR_DECODE)
700                 *p = 0;
701         return odr_missing(o, opt, name);
702 }
703
704 int z_ElementSetNames (ODR o, Z_ElementSetNames **p, int opt, const char *name)
705 {
706         static Odr_arm arm[] = {
707                 {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ElementSetNames_generic,
708                 (Odr_fun) z_InternationalString, "generic"},
709                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSetNames_databaseSpecific,
710                 (Odr_fun) z_DatabaseSpecific, "databaseSpecific"},
711                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
712         };
713         if (!odr_initmember(o, p, sizeof(**p)))
714                 return odr_missing(o, opt, name);
715         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
716                 return 1;
717         if(o->direction == ODR_DECODE)
718                 *p = 0;
719         return odr_missing(o, opt, name);
720 }
721
722 int z_PresentStatus (ODR o, Z_PresentStatus **p, int opt, const char *name)
723 {
724         return odr_implicit_tag (o, odr_integer, p, ODR_CONTEXT, 27, opt, name);
725 }
726
727 int z_DbSpecific (ODR o, Z_DbSpecific **p, int opt, const char *name)
728 {
729         if (!odr_sequence_begin (o, p, sizeof(**p), name))
730                 return odr_missing(o, opt, name) && odr_ok (o);
731         return
732                 odr_explicit_tag (o, z_DatabaseName,
733                         &(*p)->db, ODR_CONTEXT, 1, 0, "db") &&
734                 odr_implicit_tag (o, z_Specification,
735                         &(*p)->spec, ODR_CONTEXT, 2, 0, "spec") &&
736                 odr_sequence_end (o);
737 }
738
739 int z_CompSpec (ODR o, Z_CompSpec **p, int opt, const char *name)
740 {
741         if (!odr_sequence_begin (o, p, sizeof(**p), name))
742                 return odr_missing(o, opt, name) && odr_ok (o);
743         return
744                 odr_implicit_tag (o, odr_bool,
745                         &(*p)->selectAlternativeSyntax, ODR_CONTEXT, 1, 0, "selectAlternativeSyntax") &&
746                 odr_implicit_tag (o, z_Specification,
747                         &(*p)->generic, ODR_CONTEXT, 2, 1, "generic") &&
748                 odr_implicit_settag (o, ODR_CONTEXT, 3) &&
749                 (odr_sequence_of(o, (Odr_fun) z_DbSpecific, &(*p)->dbSpecific,
750                   &(*p)->num_dbSpecific, "dbSpecific") || odr_ok(o)) &&
751                 odr_implicit_settag (o, ODR_CONTEXT, 4) &&
752                 (odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->recordSyntax,
753                   &(*p)->num_recordSyntax, "recordSyntax") || odr_ok(o)) &&
754                 odr_sequence_end (o);
755 }
756
757 int z_ElementSpec (ODR o, Z_ElementSpec **p, int opt, const char *name)
758 {
759         static Odr_arm arm[] = {
760                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSpec_elementSetName,
761                 (Odr_fun) z_InternationalString, "elementSetName"},
762                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementSpec_externalSpec,
763                 (Odr_fun) z_External, "externalSpec"},
764                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
765         };
766         if (!odr_initmember(o, p, sizeof(**p)))
767                 return odr_missing(o, opt, name);
768         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
769                 return 1;
770         if(o->direction == ODR_DECODE)
771                 *p = 0;
772         return odr_missing(o, opt, name);
773 }
774
775 int z_Specification (ODR o, Z_Specification **p, int opt, const char *name)
776 {
777         static Odr_arm arm[] = {
778                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Schema_oid,
779                 (Odr_fun) odr_oid, "oid"},
780                 {ODR_IMPLICIT, ODR_CONTEXT, 300, Z_Schema_uri,
781                 (Odr_fun) z_InternationalString, "uri"},
782                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
783         };
784         if (!odr_sequence_begin (o, p, sizeof(**p), name))
785                 return odr_missing(o, opt, name) && odr_ok (o);
786         return
787                 (odr_choice (o, arm, &(*p)->schema, &(*p)->which, 0) || odr_ok(o)) &&
788                 odr_explicit_tag (o, z_ElementSpec,
789                         &(*p)->elementSpec, ODR_CONTEXT, 2, 1, "elementSpec") &&
790                 odr_sequence_end (o);
791 }
792
793 int z_DeleteResultSetRequest (ODR o, Z_DeleteResultSetRequest **p, int opt, const char *name)
794 {
795         if (!odr_sequence_begin (o, p, sizeof(**p), name))
796                 return odr_missing(o, opt, name) && odr_ok (o);
797         return
798                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
799                 odr_implicit_tag (o, odr_integer,
800                         &(*p)->deleteFunction, ODR_CONTEXT, 32, 0, "deleteFunction") &&
801                 (odr_sequence_of(o, (Odr_fun) z_ResultSetId, &(*p)->resultSetList,
802                   &(*p)->num_resultSetList, "resultSetList") || odr_ok(o)) &&
803                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
804                 odr_sequence_end (o);
805 }
806
807 int z_DeleteResultSetResponse (ODR o, Z_DeleteResultSetResponse **p, int opt, const char *name)
808 {
809         if (!odr_sequence_begin (o, p, sizeof(**p), name))
810                 return odr_missing(o, opt, name) && odr_ok (o);
811         return
812                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
813                 odr_implicit_tag (o, z_DeleteStatus,
814                         &(*p)->deleteOperationStatus, ODR_CONTEXT, 0, 0, "deleteOperationStatus") &&
815                 odr_implicit_tag (o, z_ListStatuses,
816                         &(*p)->deleteListStatuses, ODR_CONTEXT, 1, 1, "deleteListStatuses") &&
817                 odr_implicit_tag (o, odr_integer,
818                         &(*p)->numberNotDeleted, ODR_CONTEXT, 34, 1, "numberNotDeleted") &&
819                 odr_implicit_tag (o, z_ListStatuses,
820                         &(*p)->bulkStatuses, ODR_CONTEXT, 35, 1, "bulkStatuses") &&
821                 odr_implicit_tag (o, z_InternationalString,
822                         &(*p)->deleteMessage, ODR_CONTEXT, 36, 1, "deleteMessage") &&
823                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
824                 odr_sequence_end (o);
825 }
826
827 int z_ListStatus (ODR o, Z_ListStatus **p, int opt, const char *name)
828 {
829         if (!odr_sequence_begin (o, p, sizeof(**p), name))
830                 return odr_missing(o, opt, name) && odr_ok (o);
831         return
832                 z_ResultSetId(o, &(*p)->id, 0, "id") &&
833                 z_DeleteStatus(o, &(*p)->status, 0, "status") &&
834                 odr_sequence_end (o);
835 }
836
837 int z_ListStatuses (ODR o, Z_ListStatuses **p, int opt, const char *name)
838 {
839         if (!odr_initmember (o, p, sizeof(**p)))
840                 return odr_missing(o, opt, name);
841         if (odr_sequence_of (o, (Odr_fun) z_ListStatus, &(*p)->elements,
842                 &(*p)->num, name))
843                 return 1;
844         if(o->direction == ODR_DECODE)
845                 *p = 0;
846         return odr_missing(o, opt, name);
847 }
848
849 int z_DeleteStatus (ODR o, Z_DeleteStatus **p, int opt, const char *name)
850 {
851         return odr_implicit_tag (o, odr_integer, p, ODR_CONTEXT, 33, opt, name);
852 }
853
854 int z_AccessControlRequest (ODR o, Z_AccessControlRequest **p, int opt, const char *name)
855 {
856         static Odr_arm arm[] = {
857                 {ODR_IMPLICIT, ODR_CONTEXT, 37, Z_AccessControlRequest_simpleForm,
858                 (Odr_fun) odr_octetstring, "simpleForm"},
859                 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessControlRequest_externallyDefined,
860                 (Odr_fun) z_External, "externallyDefined"},
861                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
862         };
863         if (!odr_sequence_begin (o, p, sizeof(**p), name))
864                 return odr_missing(o, opt, name) && odr_ok (o);
865         return
866                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
867                 odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) &&
868                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
869                 odr_sequence_end (o);
870 }
871
872 int z_AccessControlResponse (ODR o, Z_AccessControlResponse **p, int opt, const char *name)
873 {
874         static Odr_arm arm[] = {
875                 {ODR_IMPLICIT, ODR_CONTEXT, 38, Z_AccessControlResponse_simpleForm,
876                 (Odr_fun) odr_octetstring, "simpleForm"},
877                 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessControlResponse_externallyDefined,
878                 (Odr_fun) z_External, "externallyDefined"},
879                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
880         };
881         if (!odr_sequence_begin (o, p, sizeof(**p), name))
882                 return odr_missing(o, opt, name) && odr_ok (o);
883         return
884                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
885                 (odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) || odr_ok(o)) &&
886                 odr_explicit_tag (o, z_DiagRec,
887                         &(*p)->diagnostic, ODR_CONTEXT, 223, 1, "diagnostic") &&
888                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
889                 odr_sequence_end (o);
890 }
891
892 int z_ResourceControlRequest (ODR o, Z_ResourceControlRequest **p, int opt, const char *name)
893 {
894         if (!odr_sequence_begin (o, p, sizeof(**p), name))
895                 return odr_missing(o, opt, name) && odr_ok (o);
896         return
897                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
898                 odr_implicit_tag (o, odr_bool,
899                         &(*p)->suspendedFlag, ODR_CONTEXT, 39, 1, "suspendedFlag") &&
900                 odr_explicit_tag (o, z_ResourceReport,
901                         &(*p)->resourceReport, ODR_CONTEXT, 40, 1, "resourceReport") &&
902                 odr_implicit_tag (o, odr_integer,
903                         &(*p)->partialResultsAvailable, ODR_CONTEXT, 41, 1, "partialResultsAvailable") &&
904                 odr_implicit_tag (o, odr_bool,
905                         &(*p)->responseRequired, ODR_CONTEXT, 42, 0, "responseRequired") &&
906                 odr_implicit_tag (o, odr_bool,
907                         &(*p)->triggeredRequestFlag, ODR_CONTEXT, 43, 1, "triggeredRequestFlag") &&
908                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
909                 odr_sequence_end (o);
910 }
911
912 int z_ResourceControlResponse (ODR o, Z_ResourceControlResponse **p, int opt, const char *name)
913 {
914         if (!odr_sequence_begin (o, p, sizeof(**p), name))
915                 return odr_missing(o, opt, name) && odr_ok (o);
916         return
917                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
918                 odr_implicit_tag (o, odr_bool,
919                         &(*p)->continueFlag, ODR_CONTEXT, 44, 0, "continueFlag") &&
920                 odr_implicit_tag (o, odr_bool,
921                         &(*p)->resultSetWanted, ODR_CONTEXT, 45, 1, "resultSetWanted") &&
922                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
923                 odr_sequence_end (o);
924 }
925
926 int z_TriggerResourceControlRequest (ODR o, Z_TriggerResourceControlRequest **p, int opt, const char *name)
927 {
928         if (!odr_sequence_begin (o, p, sizeof(**p), name))
929                 return odr_missing(o, opt, name) && odr_ok (o);
930         return
931                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
932                 odr_implicit_tag (o, odr_integer,
933                         &(*p)->requestedAction, ODR_CONTEXT, 46, 0, "requestedAction") &&
934                 odr_implicit_tag (o, z_ResourceReportId,
935                         &(*p)->prefResourceReportFormat, ODR_CONTEXT, 47, 1, "prefResourceReportFormat") &&
936                 odr_implicit_tag (o, odr_bool,
937                         &(*p)->resultSetWanted, ODR_CONTEXT, 48, 1, "resultSetWanted") &&
938                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
939                 odr_sequence_end (o);
940 }
941
942 int z_ResourceReportRequest (ODR o, Z_ResourceReportRequest **p, int opt, const char *name)
943 {
944         if (!odr_sequence_begin (o, p, sizeof(**p), name))
945                 return odr_missing(o, opt, name) && odr_ok (o);
946         return
947                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
948                 odr_implicit_tag (o, z_ReferenceId,
949                         &(*p)->opId, ODR_CONTEXT, 210, 1, "opId") &&
950                 odr_implicit_tag (o, z_ResourceReportId,
951                         &(*p)->prefResourceReportFormat, ODR_CONTEXT, 49, 1, "prefResourceReportFormat") &&
952                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
953                 odr_sequence_end (o);
954 }
955
956 int z_ResourceReportResponse (ODR o, Z_ResourceReportResponse **p, int opt, const char *name)
957 {
958         if (!odr_sequence_begin (o, p, sizeof(**p), name))
959                 return odr_missing(o, opt, name) && odr_ok (o);
960         return
961                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
962                 odr_implicit_tag (o, odr_integer,
963                         &(*p)->resourceReportStatus, ODR_CONTEXT, 50, 0, "resourceReportStatus") &&
964                 odr_explicit_tag (o, z_ResourceReport,
965                         &(*p)->resourceReport, ODR_CONTEXT, 51, 1, "resourceReport") &&
966                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
967                 odr_sequence_end (o);
968 }
969
970 int z_ResourceReport (ODR o, Z_ResourceReport **p, int opt, const char *name)
971 {
972         return z_External (o, p, opt, name);
973 }
974
975 int z_ResourceReportId (ODR o, Z_ResourceReportId **p, int opt, const char *name)
976 {
977         return odr_oid (o, p, opt, name);
978 }
979
980 int z_ScanRequest (ODR o, Z_ScanRequest **p, int opt, const char *name)
981 {
982         if (!odr_sequence_begin (o, p, sizeof(**p), name))
983                 return odr_missing(o, opt, name) && odr_ok (o);
984         return
985                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
986                 odr_implicit_settag (o, ODR_CONTEXT, 3) &&
987                 odr_sequence_of(o, (Odr_fun) z_DatabaseName, &(*p)->databaseNames,
988                   &(*p)->num_databaseNames, "databaseNames") &&
989                 z_AttributeSetId(o, &(*p)->attributeSet, 1, "attributeSet") &&
990                 z_AttributesPlusTerm(o, &(*p)->termListAndStartPoint, 0, "termListAndStartPoint") &&
991                 odr_implicit_tag (o, odr_integer,
992                         &(*p)->stepSize, ODR_CONTEXT, 5, 1, "stepSize") &&
993                 odr_implicit_tag (o, odr_integer,
994                         &(*p)->numberOfTermsRequested, ODR_CONTEXT, 6, 0, "numberOfTermsRequested") &&
995                 odr_implicit_tag (o, odr_integer,
996                         &(*p)->preferredPositionInResponse, ODR_CONTEXT, 7, 1, "preferredPositionInResponse") &&
997                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
998                 odr_sequence_end (o);
999 }
1000
1001 int z_ScanResponse (ODR o, Z_ScanResponse **p, int opt, const char *name)
1002 {
1003         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1004                 return odr_missing(o, opt, name) && odr_ok (o);
1005         return
1006                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
1007                 odr_implicit_tag (o, odr_integer,
1008                         &(*p)->stepSize, ODR_CONTEXT, 3, 1, "stepSize") &&
1009                 odr_implicit_tag (o, odr_integer,
1010                         &(*p)->scanStatus, ODR_CONTEXT, 4, 0, "scanStatus") &&
1011                 odr_implicit_tag (o, odr_integer,
1012                         &(*p)->numberOfEntriesReturned, ODR_CONTEXT, 5, 0, "numberOfEntriesReturned") &&
1013                 odr_implicit_tag (o, odr_integer,
1014                         &(*p)->positionOfTerm, ODR_CONTEXT, 6, 1, "positionOfTerm") &&
1015                 odr_implicit_tag (o, z_ListEntries,
1016                         &(*p)->entries, ODR_CONTEXT, 7, 1, "entries") &&
1017                 odr_implicit_tag (o, z_AttributeSetId,
1018                         &(*p)->attributeSet, ODR_CONTEXT, 8, 1, "attributeSet") &&
1019                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
1020                 odr_sequence_end (o);
1021 }
1022
1023 int z_ListEntries (ODR o, Z_ListEntries **p, int opt, const char *name)
1024 {
1025         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1026                 return odr_missing(o, opt, name) && odr_ok (o);
1027         return
1028                 odr_implicit_settag (o, ODR_CONTEXT, 1) &&
1029                 (odr_sequence_of(o, (Odr_fun) z_Entry, &(*p)->entries,
1030                   &(*p)->num_entries, "entries") || odr_ok(o)) &&
1031                 odr_implicit_settag (o, ODR_CONTEXT, 2) &&
1032                 (odr_sequence_of(o, (Odr_fun) z_DiagRec, &(*p)->nonsurrogateDiagnostics,
1033                   &(*p)->num_nonsurrogateDiagnostics, "nonsurrogateDiagnostics") || odr_ok(o)) &&
1034                 odr_sequence_end (o);
1035 }
1036
1037 int z_Entry (ODR o, Z_Entry **p, int opt, const char *name)
1038 {
1039         static Odr_arm arm[] = {
1040                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Entry_termInfo,
1041                 (Odr_fun) z_TermInfo, "termInfo"},
1042                 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Entry_surrogateDiagnostic,
1043                 (Odr_fun) z_DiagRec, "surrogateDiagnostic"},
1044                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
1045         };
1046         if (!odr_initmember(o, p, sizeof(**p)))
1047                 return odr_missing(o, opt, name);
1048         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
1049                 return 1;
1050         if(o->direction == ODR_DECODE)
1051                 *p = 0;
1052         return odr_missing(o, opt, name);
1053 }
1054
1055 int z_TermInfo (ODR o, Z_TermInfo **p, int opt, const char *name)
1056 {
1057         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1058                 return odr_missing(o, opt, name) && odr_ok (o);
1059         return
1060                 z_Term(o, &(*p)->term, 0, "term") &&
1061                 odr_implicit_tag (o, z_InternationalString,
1062                         &(*p)->displayTerm, ODR_CONTEXT, 0, 1, "displayTerm") &&
1063                 z_AttributeList(o, &(*p)->suggestedAttributes, 1, "suggestedAttributes") &&
1064                 odr_implicit_settag (o, ODR_CONTEXT, 4) &&
1065                 (odr_sequence_of(o, (Odr_fun) z_AttributesPlusTerm, &(*p)->alternativeTerm,
1066                   &(*p)->num_alternativeTerm, "alternativeTerm") || odr_ok(o)) &&
1067                 odr_implicit_tag (o, odr_integer,
1068                         &(*p)->globalOccurrences, ODR_CONTEXT, 2, 1, "globalOccurrences") &&
1069                 odr_implicit_tag (o, z_OccurrenceByAttributes,
1070                         &(*p)->byAttributes, ODR_CONTEXT, 3, 1, "byAttributes") &&
1071                 z_OtherInformation(o, &(*p)->otherTermInfo, 1, "otherTermInfo") &&
1072                 odr_sequence_end (o);
1073 }
1074
1075 int z_byDatabaseList_s (ODR o, Z_byDatabaseList_s **p, int opt, const char *name)
1076 {
1077         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1078                 return odr_missing(o, opt, name) && odr_ok (o);
1079         return
1080                 z_DatabaseName(o, &(*p)->db, 0, "db") &&
1081                 odr_implicit_tag (o, odr_integer,
1082                         &(*p)->num, ODR_CONTEXT, 1, 1, "num") &&
1083                 z_OtherInformation(o, &(*p)->otherDbInfo, 1, "otherDbInfo") &&
1084                 odr_sequence_end (o);
1085 }
1086
1087 int z_byDatabaseList (ODR o, Z_byDatabaseList **p, int opt, const char *name)
1088 {
1089         if (!odr_initmember (o, p, sizeof(**p)))
1090                 return odr_missing(o, opt, name);
1091         if (odr_sequence_of (o, (Odr_fun) z_byDatabaseList_s, &(*p)->elements,
1092                 &(*p)->num, name))
1093                 return 1;
1094         if(o->direction == ODR_DECODE)
1095                 *p = 0;
1096         return odr_missing(o, opt, name);
1097 }
1098
1099 int z_OccurrenceByAttributesElem (ODR o, Z_OccurrenceByAttributesElem **p, int opt, const char *name)
1100 {
1101         static Odr_arm arm[] = {
1102                 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_OccurrenceByAttributesElem_global,
1103                 (Odr_fun) odr_integer, "global"},
1104                 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_OccurrenceByAttributesElem_byDatabase,
1105                 (Odr_fun) z_byDatabaseList, "byDatabase"},
1106                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
1107         };
1108         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1109                 return odr_missing(o, opt, name) && odr_ok (o);
1110         return
1111                 odr_explicit_tag (o, z_AttributeList,
1112                         &(*p)->attributes, ODR_CONTEXT, 1, 0, "attributes") &&
1113                 (odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) || odr_ok(o)) &&
1114                 z_OtherInformation(o, &(*p)->otherOccurInfo, 1, "otherOccurInfo") &&
1115                 odr_sequence_end (o);
1116 }
1117
1118 int z_OccurrenceByAttributes (ODR o, Z_OccurrenceByAttributes **p, int opt, const char *name)
1119 {
1120         if (!odr_initmember (o, p, sizeof(**p)))
1121                 return odr_missing(o, opt, name);
1122         if (odr_sequence_of (o, (Odr_fun) z_OccurrenceByAttributesElem, &(*p)->elements,
1123                 &(*p)->num, name))
1124                 return 1;
1125         if(o->direction == ODR_DECODE)
1126                 *p = 0;
1127         return odr_missing(o, opt, name);
1128 }
1129
1130 int z_SortKeySpecList (ODR o, Z_SortKeySpecList **p, int opt, const char *name)
1131 {
1132         if (!odr_initmember (o, p, sizeof(**p)))
1133                 return odr_missing(o, opt, name);
1134         if (odr_sequence_of (o, (Odr_fun) z_SortKeySpec, &(*p)->specs,
1135                 &(*p)->num_specs, name))
1136                 return 1;
1137         if(o->direction == ODR_DECODE)
1138                 *p = 0;
1139         return odr_missing(o, opt, name);
1140 }
1141
1142 int z_SortRequest (ODR o, Z_SortRequest **p, int opt, const char *name)
1143 {
1144         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1145                 return odr_missing(o, opt, name) && odr_ok (o);
1146         return
1147                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
1148                 odr_implicit_settag (o, ODR_CONTEXT, 3) &&
1149                 odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->inputResultSetNames,
1150                   &(*p)->num_inputResultSetNames, "inputResultSetNames") &&
1151                 odr_implicit_tag (o, z_InternationalString,
1152                         &(*p)->sortedResultSetName, ODR_CONTEXT, 4, 0, "sortedResultSetName") &&
1153                 odr_implicit_tag (o, z_SortKeySpecList,
1154                         &(*p)->sortSequence, ODR_CONTEXT, 5, 0, "sortSequence") &&
1155                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
1156                 odr_sequence_end (o);
1157 }
1158
1159 int z_SortResponse (ODR o, Z_SortResponse **p, int opt, const char *name)
1160 {
1161         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1162                 return odr_missing(o, opt, name) && odr_ok (o);
1163         return
1164                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
1165                 odr_implicit_tag (o, odr_integer,
1166                         &(*p)->sortStatus, ODR_CONTEXT, 3, 0, "sortStatus") &&
1167                 odr_implicit_tag (o, odr_integer,
1168                         &(*p)->resultSetStatus, ODR_CONTEXT, 4, 1, "resultSetStatus") &&
1169                 odr_implicit_settag (o, ODR_CONTEXT, 5) &&
1170                 (odr_sequence_of(o, (Odr_fun) z_DiagRec, &(*p)->diagnostics,
1171                   &(*p)->num_diagnostics, "diagnostics") || odr_ok(o)) &&
1172                 odr_implicit_tag (o, odr_integer,
1173                         &(*p)->resultCount, ODR_CONTEXT, 6, 1, "resultCount") &&
1174                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
1175                 odr_sequence_end (o);
1176 }
1177
1178 int z_SortKeySpec (ODR o, Z_SortKeySpec **p, int opt, const char *name)
1179 {
1180         static Odr_arm arm[] = {
1181                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKeySpec_abort,
1182                 (Odr_fun) odr_null, "abort"},
1183                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKeySpec_null,
1184                 (Odr_fun) odr_null, "null"},
1185                 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_SortKeySpec_missingValueData,
1186                 (Odr_fun) odr_octetstring, "missingValueData"},
1187                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
1188         };
1189         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1190                 return odr_missing(o, opt, name) && odr_ok (o);
1191         return
1192                 z_SortElement(o, &(*p)->sortElement, 0, "sortElement") &&
1193                 odr_implicit_tag (o, odr_integer,
1194                         &(*p)->sortRelation, ODR_CONTEXT, 1, 0, "sortRelation") &&
1195                 odr_implicit_tag (o, odr_integer,
1196                         &(*p)->caseSensitivity, ODR_CONTEXT, 2, 0, "caseSensitivity") &&
1197                 ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 3, "missingValueAction") &&
1198                 odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) &&
1199                 odr_constructed_end (o)) || odr_ok(o)) &&
1200                 odr_sequence_end (o);
1201 }
1202
1203 int z_SortDbSpecificList_s (ODR o, Z_SortDbSpecificList_s **p, int opt, const char *name)
1204 {
1205         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1206                 return odr_missing(o, opt, name) && odr_ok (o);
1207         return
1208                 z_DatabaseName(o, &(*p)->databaseName, 0, "databaseName") &&
1209                 z_SortKey(o, &(*p)->dbSort, 0, "dbSort") &&
1210                 odr_sequence_end (o);
1211 }
1212
1213 int z_SortDbSpecificList (ODR o, Z_SortDbSpecificList **p, int opt, const char *name)
1214 {
1215         if (!odr_initmember (o, p, sizeof(**p)))
1216                 return odr_missing(o, opt, name);
1217         if (odr_sequence_of (o, (Odr_fun) z_SortDbSpecificList_s, &(*p)->elements,
1218                 &(*p)->num, name))
1219                 return 1;
1220         if(o->direction == ODR_DECODE)
1221                 *p = 0;
1222         return odr_missing(o, opt, name);
1223 }
1224
1225 int z_SortElement (ODR o, Z_SortElement **p, int opt, const char *name)
1226 {
1227         static Odr_arm arm[] = {
1228                 {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_SortElement_generic,
1229                 (Odr_fun) z_SortKey, "generic"},
1230                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortElement_databaseSpecific,
1231                 (Odr_fun) z_SortDbSpecificList, "databaseSpecific"},
1232                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
1233         };
1234         if (!odr_initmember(o, p, sizeof(**p)))
1235                 return odr_missing(o, opt, name);
1236         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
1237                 return 1;
1238         if(o->direction == ODR_DECODE)
1239                 *p = 0;
1240         return odr_missing(o, opt, name);
1241 }
1242
1243 int z_SortAttributes (ODR o, Z_SortAttributes **p, int opt, const char *name)
1244 {
1245         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1246                 return odr_missing(o, opt, name) && odr_ok (o);
1247         return
1248                 z_AttributeSetId(o, &(*p)->id, 0, "id") &&
1249                 z_AttributeList(o, &(*p)->list, 0, "list") &&
1250                 odr_sequence_end (o);
1251 }
1252
1253 int z_SortKey (ODR o, Z_SortKey **p, int opt, const char *name)
1254 {
1255         static Odr_arm arm[] = {
1256                 {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKey_sortField,
1257                 (Odr_fun) z_InternationalString, "sortField"},
1258                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKey_elementSpec,
1259                 (Odr_fun) z_Specification, "elementSpec"},
1260                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKey_sortAttributes,
1261                 (Odr_fun) z_SortAttributes, "sortAttributes"},
1262                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
1263         };
1264         if (!odr_initmember(o, p, sizeof(**p)))
1265                 return odr_missing(o, opt, name);
1266         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
1267                 return 1;
1268         if(o->direction == ODR_DECODE)
1269                 *p = 0;
1270         return odr_missing(o, opt, name);
1271 }
1272
1273 int z_ExtendedServicesRequest (ODR o, Z_ExtendedServicesRequest **p, int opt, const char *name)
1274 {
1275         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1276                 return odr_missing(o, opt, name) && odr_ok (o);
1277         return
1278                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
1279                 odr_implicit_tag (o, odr_integer,
1280                         &(*p)->function, ODR_CONTEXT, 3, 0, "function") &&
1281                 odr_implicit_tag (o, odr_oid,
1282                         &(*p)->packageType, ODR_CONTEXT, 4, 0, "packageType") &&
1283                 odr_implicit_tag (o, z_InternationalString,
1284                         &(*p)->packageName, ODR_CONTEXT, 5, 1, "packageName") &&
1285                 odr_implicit_tag (o, z_InternationalString,
1286                         &(*p)->userId, ODR_CONTEXT, 6, 1, "userId") &&
1287                 odr_implicit_tag (o, z_IntUnit,
1288                         &(*p)->retentionTime, ODR_CONTEXT, 7, 1, "retentionTime") &&
1289                 odr_implicit_tag (o, z_Permissions,
1290                         &(*p)->permissions, ODR_CONTEXT, 8, 1, "permissions") &&
1291                 odr_implicit_tag (o, z_InternationalString,
1292                         &(*p)->description, ODR_CONTEXT, 9, 1, "description") &&
1293                 odr_implicit_tag (o, z_External,
1294                         &(*p)->taskSpecificParameters, ODR_CONTEXT, 10, 1, "taskSpecificParameters") &&
1295                 odr_implicit_tag (o, odr_integer,
1296                         &(*p)->waitAction, ODR_CONTEXT, 11, 0, "waitAction") &&
1297                 z_ElementSetName(o, &(*p)->elements, 1, "elements") &&
1298                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
1299                 odr_sequence_end (o);
1300 }
1301
1302 int z_ExtendedServicesResponse (ODR o, Z_ExtendedServicesResponse **p, int opt, const char *name)
1303 {
1304         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1305                 return odr_missing(o, opt, name) && odr_ok (o);
1306         return
1307                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
1308                 odr_implicit_tag (o, odr_integer,
1309                         &(*p)->operationStatus, ODR_CONTEXT, 3, 0, "operationStatus") &&
1310                 odr_implicit_settag (o, ODR_CONTEXT, 4) &&
1311                 (odr_sequence_of(o, (Odr_fun) z_DiagRec, &(*p)->diagnostics,
1312                   &(*p)->num_diagnostics, "diagnostics") || odr_ok(o)) &&
1313                 odr_implicit_tag (o, z_External,
1314                         &(*p)->taskPackage, ODR_CONTEXT, 5, 1, "taskPackage") &&
1315                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
1316                 odr_sequence_end (o);
1317 }
1318
1319 int z_Permissions_s (ODR o, Z_Permissions_s **p, int opt, const char *name)
1320 {
1321         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1322                 return odr_missing(o, opt, name) && odr_ok (o);
1323         return
1324                 odr_implicit_tag (o, z_InternationalString,
1325                         &(*p)->userId, ODR_CONTEXT, 1, 0, "userId") &&
1326                 odr_implicit_settag (o, ODR_CONTEXT, 2) &&
1327                 odr_sequence_of(o, (Odr_fun) odr_integer, &(*p)->allowableFunctions,
1328                   &(*p)->num_allowableFunctions, "allowableFunctions") &&
1329                 odr_sequence_end (o);
1330 }
1331
1332 int z_Permissions (ODR o, Z_Permissions **p, int opt, const char *name)
1333 {
1334         if (!odr_initmember (o, p, sizeof(**p)))
1335                 return odr_missing(o, opt, name);
1336         if (odr_sequence_of (o, (Odr_fun) z_Permissions_s, &(*p)->elements,
1337                 &(*p)->num, name))
1338                 return 1;
1339         if(o->direction == ODR_DECODE)
1340                 *p = 0;
1341         return odr_missing(o, opt, name);
1342 }
1343
1344 int z_Close (ODR o, Z_Close **p, int opt, const char *name)
1345 {
1346         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1347                 return odr_missing(o, opt, name) && odr_ok (o);
1348         return
1349                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
1350                 z_CloseReason(o, &(*p)->closeReason, 0, "closeReason") &&
1351                 odr_implicit_tag (o, z_InternationalString,
1352                         &(*p)->diagnosticInformation, ODR_CONTEXT, 3, 1, "diagnosticInformation") &&
1353                 odr_implicit_tag (o, z_ResourceReportId,
1354                         &(*p)->resourceReportFormat, ODR_CONTEXT, 4, 1, "resourceReportFormat") &&
1355                 odr_explicit_tag (o, z_ResourceReport,
1356                         &(*p)->resourceReport, ODR_CONTEXT, 5, 1, "resourceReport") &&
1357                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
1358                 odr_sequence_end (o);
1359 }
1360
1361 int z_CloseReason (ODR o, Z_CloseReason **p, int opt, const char *name)
1362 {
1363         return odr_implicit_tag (o, odr_integer, p, ODR_CONTEXT, 211, opt, name);
1364 }
1365
1366 int z_DuplicateDetectionRequest (ODR o, Z_DuplicateDetectionRequest **p, int opt, const char *name)
1367 {
1368         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1369                 return odr_missing(o, opt, name) && odr_ok (o);
1370         return
1371                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
1372                 odr_implicit_settag (o, ODR_CONTEXT, 3) &&
1373                 odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->inputResultSetIds,
1374                   &(*p)->num_inputResultSetIds, "inputResultSetIds") &&
1375                 odr_implicit_tag (o, z_InternationalString,
1376                         &(*p)->outputResultSetName, ODR_CONTEXT, 4, 0, "outputResultSetName") &&
1377                 odr_implicit_tag (o, z_External,
1378                         &(*p)->applicablePortionOfRecord, ODR_CONTEXT, 5, 1, "applicablePortionOfRecord") &&
1379                 odr_implicit_settag (o, ODR_CONTEXT, 6) &&
1380                 (odr_sequence_of(o, (Odr_fun) z_DuplicateDetectionCriterion, &(*p)->duplicateDetectionCriteria,
1381                   &(*p)->num_duplicateDetectionCriteria, "duplicateDetectionCriteria") || odr_ok(o)) &&
1382                 odr_implicit_tag (o, odr_bool,
1383                         &(*p)->clustering, ODR_CONTEXT, 7, 1, "clustering") &&
1384                 odr_implicit_settag (o, ODR_CONTEXT, 8) &&
1385                 odr_sequence_of(o, (Odr_fun) z_RetentionCriterion, &(*p)->retentionCriteria,
1386                   &(*p)->num_retentionCriteria, "retentionCriteria") &&
1387                 odr_implicit_settag (o, ODR_CONTEXT, 9) &&
1388                 (odr_sequence_of(o, (Odr_fun) z_SortCriterion, &(*p)->sortCriteria,
1389                   &(*p)->num_sortCriteria, "sortCriteria") || odr_ok(o)) &&
1390                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
1391                 odr_sequence_end (o);
1392 }
1393
1394 int z_DuplicateDetectionCriterion (ODR o, Z_DuplicateDetectionCriterion **p, int opt, const char *name)
1395 {
1396         static Odr_arm arm[] = {
1397                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_DuplicateDetectionCriterion_levelOfMatch,
1398                 (Odr_fun) odr_integer, "levelOfMatch"},
1399                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_DuplicateDetectionCriterion_caseSensitive,
1400                 (Odr_fun) odr_null, "caseSensitive"},
1401                 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_DuplicateDetectionCriterion_punctuationSensitive,
1402                 (Odr_fun) odr_null, "punctuationSensitive"},
1403                 {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_DuplicateDetectionCriterion_regularExpression,
1404                 (Odr_fun) z_External, "regularExpression"},
1405                 {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_DuplicateDetectionCriterion_rsDuplicates,
1406                 (Odr_fun) odr_null, "rsDuplicates"},
1407                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
1408         };
1409         if (!odr_initmember(o, p, sizeof(**p)))
1410                 return odr_missing(o, opt, name);
1411         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
1412                 return 1;
1413         if(o->direction == ODR_DECODE)
1414                 *p = 0;
1415         return odr_missing(o, opt, name);
1416 }
1417
1418 int z_RetentionCriterion (ODR o, Z_RetentionCriterion **p, int opt, const char *name)
1419 {
1420         static Odr_arm arm[] = {
1421                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_RetentionCriterion_numberOfEntries,
1422                 (Odr_fun) odr_integer, "numberOfEntries"},
1423                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_RetentionCriterion_percentOfEntries,
1424                 (Odr_fun) odr_integer, "percentOfEntries"},
1425                 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_RetentionCriterion_duplicatesOnly,
1426                 (Odr_fun) odr_null, "duplicatesOnly"},
1427                 {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_RetentionCriterion_discardRsDuplicates,
1428                 (Odr_fun) odr_null, "discardRsDuplicates"},
1429                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
1430         };
1431         if (!odr_initmember(o, p, sizeof(**p)))
1432                 return odr_missing(o, opt, name);
1433         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
1434                 return 1;
1435         if(o->direction == ODR_DECODE)
1436                 *p = 0;
1437         return odr_missing(o, opt, name);
1438 }
1439
1440 int z_SortCriterionPreferredDatabases (ODR o, Z_SortCriterionPreferredDatabases **p, int opt, const char *name)
1441 {
1442         if (!odr_initmember (o, p, sizeof(**p)))
1443                 return odr_missing(o, opt, name);
1444         if (odr_sequence_of (o, (Odr_fun) z_InternationalString, &(*p)->elements,
1445                 &(*p)->num, name))
1446                 return 1;
1447         if(o->direction == ODR_DECODE)
1448                 *p = 0;
1449         return odr_missing(o, opt, name);
1450 }
1451
1452 int z_SortCriterion (ODR o, Z_SortCriterion **p, int opt, const char *name)
1453 {
1454         static Odr_arm arm[] = {
1455                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortCriterion_mostComprehensive,
1456                 (Odr_fun) odr_null, "mostComprehensive"},
1457                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortCriterion_leastConmprehensive,
1458                 (Odr_fun) odr_null, "leastConmprehensive"},
1459                 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_SortCriterion_mostRecent,
1460                 (Odr_fun) odr_null, "mostRecent"},
1461                 {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_SortCriterion_oldest,
1462                 (Odr_fun) odr_null, "oldest"},
1463                 {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_SortCriterion_leastCost,
1464                 (Odr_fun) odr_null, "leastCost"},
1465                 {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_SortCriterion_preferredDatabases,
1466                 (Odr_fun) z_SortCriterionPreferredDatabases, "preferredDatabases"},
1467                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
1468         };
1469         if (!odr_initmember(o, p, sizeof(**p)))
1470                 return odr_missing(o, opt, name);
1471         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
1472                 return 1;
1473         if(o->direction == ODR_DECODE)
1474                 *p = 0;
1475         return odr_missing(o, opt, name);
1476 }
1477
1478 int z_DuplicateDetectionResponse (ODR o, Z_DuplicateDetectionResponse **p, int opt, const char *name)
1479 {
1480         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1481                 return odr_missing(o, opt, name) && odr_ok (o);
1482         return
1483                 z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") &&
1484                 odr_implicit_tag (o, odr_integer,
1485                         &(*p)->status, ODR_CONTEXT, 3, 0, "status") &&
1486                 odr_implicit_tag (o, odr_integer,
1487                         &(*p)->resultSetCount, ODR_CONTEXT, 4, 1, "resultSetCount") &&
1488                 odr_implicit_settag (o, ODR_CONTEXT, 5) &&
1489                 (odr_sequence_of(o, (Odr_fun) z_DiagRec, &(*p)->diagnostics,
1490                   &(*p)->num_diagnostics, "diagnostics") || odr_ok(o)) &&
1491                 z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") &&
1492                 odr_sequence_end (o);
1493 }
1494
1495 int z_ReferenceId (ODR o, Z_ReferenceId **p, int opt, const char *name)
1496 {
1497         return odr_implicit_tag (o, odr_octetstring, p, ODR_CONTEXT, 2, opt, name);
1498 }
1499
1500 int z_ResultSetId (ODR o, Z_ResultSetId **p, int opt, const char *name)
1501 {
1502         return odr_implicit_tag (o, z_InternationalString, p, ODR_CONTEXT, 31, opt, name);
1503 }
1504
1505 int z_ElementSetName (ODR o, Z_ElementSetName **p, int opt, const char *name)
1506 {
1507         return odr_implicit_tag (o, z_InternationalString, p, ODR_CONTEXT, 103, opt, name);
1508 }
1509
1510 int z_DatabaseName (ODR o, Z_DatabaseName **p, int opt, const char *name)
1511 {
1512         return odr_implicit_tag (o, z_InternationalString, p, ODR_CONTEXT, 105, opt, name);
1513 }
1514
1515 int z_AttributeSetId (ODR o, Z_AttributeSetId **p, int opt, const char *name)
1516 {
1517         return odr_oid (o, p, opt, name);
1518 }
1519
1520 int z_OtherInformationUnit (ODR o, Z_OtherInformationUnit **p, int opt, const char *name)
1521 {
1522         static Odr_arm arm[] = {
1523                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_OtherInfo_characterInfo,
1524                 (Odr_fun) z_InternationalString, "characterInfo"},
1525                 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_OtherInfo_binaryInfo,
1526                 (Odr_fun) odr_octetstring, "binaryInfo"},
1527                 {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_OtherInfo_externallyDefinedInfo,
1528                 (Odr_fun) z_External, "externallyDefinedInfo"},
1529                 {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_OtherInfo_oid,
1530                 (Odr_fun) odr_oid, "oid"},
1531                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
1532         };
1533         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1534                 return odr_missing(o, opt, name) && odr_ok (o);
1535         return
1536                 odr_implicit_tag (o, z_InfoCategory,
1537                         &(*p)->category, ODR_CONTEXT, 1, 1, "category") &&
1538                 odr_choice (o, arm, &(*p)->information, &(*p)->which, 0) &&
1539                 odr_sequence_end (o);
1540 }
1541
1542 int z_OtherInformation (ODR o, Z_OtherInformation **p, int opt, const char *name)
1543 {
1544         if (!odr_initmember (o, p, sizeof(**p)))
1545                 return odr_missing(o, opt, name);
1546         odr_implicit_settag (o, ODR_CONTEXT, 201);
1547         if (odr_sequence_of (o, (Odr_fun) z_OtherInformationUnit, &(*p)->list,
1548                 &(*p)->num_elements, name))
1549                 return 1;
1550         if(o->direction == ODR_DECODE)
1551                 *p = 0;
1552         return odr_missing(o, opt, name);
1553 }
1554
1555 int z_InfoCategory (ODR o, Z_InfoCategory **p, int opt, const char *name)
1556 {
1557         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1558                 return odr_missing(o, opt, name) && odr_ok (o);
1559         return
1560                 odr_implicit_tag (o, odr_oid,
1561                         &(*p)->categoryTypeId, ODR_CONTEXT, 1, 1, "categoryTypeId") &&
1562                 odr_implicit_tag (o, odr_integer,
1563                         &(*p)->categoryValue, ODR_CONTEXT, 2, 0, "categoryValue") &&
1564                 odr_sequence_end (o);
1565 }
1566
1567 int z_IntUnit (ODR o, Z_IntUnit **p, int opt, const char *name)
1568 {
1569         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1570                 return odr_missing(o, opt, name) && odr_ok (o);
1571         return
1572                 odr_implicit_tag (o, odr_integer,
1573                         &(*p)->value, ODR_CONTEXT, 1, 0, "value") &&
1574                 odr_implicit_tag (o, z_Unit,
1575                         &(*p)->unitUsed, ODR_CONTEXT, 2, 0, "unitUsed") &&
1576                 odr_sequence_end (o);
1577 }
1578
1579 int z_Unit (ODR o, Z_Unit **p, int opt, const char *name)
1580 {
1581         if (!odr_sequence_begin (o, p, sizeof(**p), name))
1582                 return odr_missing(o, opt, name) && odr_ok (o);
1583         return
1584                 odr_explicit_tag (o, z_InternationalString,
1585                         &(*p)->unitSystem, ODR_CONTEXT, 1, 1, "unitSystem") &&
1586                 odr_explicit_tag (o, z_StringOrNumeric,
1587                         &(*p)->unitType, ODR_CONTEXT, 2, 1, "unitType") &&
1588                 odr_explicit_tag (o, z_StringOrNumeric,
1589                         &(*p)->unit, ODR_CONTEXT, 3, 1, "unit") &&
1590                 odr_implicit_tag (o, odr_integer,
1591                         &(*p)->scaleFactor, ODR_CONTEXT, 4, 1, "scaleFactor") &&
1592                 odr_sequence_end (o);
1593 }
1594
1595 int z_InternationalString (ODR o, Z_InternationalString **p, int opt, const char *name)
1596 {
1597         return odr_generalstring (o, p, opt, name);
1598 }
1599
1600 int z_StringOrNumeric (ODR o, Z_StringOrNumeric **p, int opt, const char *name)
1601 {
1602         static Odr_arm arm[] = {
1603                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_StringOrNumeric_string,
1604                 (Odr_fun) z_InternationalString, "string"},
1605                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_StringOrNumeric_numeric,
1606                 (Odr_fun) odr_integer, "numeric"},
1607                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
1608         };
1609         if (!odr_initmember(o, p, sizeof(**p)))
1610                 return odr_missing(o, opt, name);
1611         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
1612                 return 1;
1613         if(o->direction == ODR_DECODE)
1614                 *p = 0;
1615         return odr_missing(o, opt, name);
1616 }
1617
1618
1619 /* the type-0 query ... */
1620 int z_ANY_type_0 (ODR o, void **p, int opt)
1621 {
1622     return 0;
1623 }
1624
1625