+/* ----------------------DELETE -------------------------- */
+
+int z_DeleteSetStatus(ODR o, int **p, int opt)
+{
+ return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 33, opt);
+}
+
+int z_ListStatus(ODR o, Z_ListStatus **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_ResultSetId(o, &(*p)->id, 0) &&
+ z_DeleteSetStatus(o, &(*p)->status, 0) &&
+ odr_sequence_end(o);
+}
+
+int z_DeleteResultSetRequest(ODR o, Z_DeleteResultSetRequest **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1) &&
+ odr_implicit(o, odr_integer, &(*p)->deleteFunction, ODR_CONTEXT, 32,
+ 0) &&
+ (odr_sequence_of(o, z_ListStatus, &(*p)->resultSetList,
+ &(*p)->num_ids) || odr_ok(o)) &&
+#ifdef Z_95
+ z_OtherInformation(o, &(*p)->otherInfo, 1) &&
+#endif
+ odr_sequence_end(o);
+}
+
+int z_DeleteResultSetResponse(ODR o, Z_DeleteResultSetResponse **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1) &&
+ odr_implicit(o, z_DeleteSetStatus, &(*p)->deleteOperationStatus,
+ ODR_CONTEXT, 0, 1) &&
+ odr_implicit_settag(o, ODR_CONTEXT, 1) &&
+ (odr_sequence_of(o, z_ListStatus, &(*p)->deleteListStatuses,
+ &(*p)->num_statuses) || odr_ok(o)) &&
+ odr_implicit(o, odr_integer, &(*p)->numberNotDeleted, ODR_CONTEXT,
+ 34, 1) &&
+ odr_implicit_settag(o, ODR_CONTEXT, 35) &&
+ (odr_sequence_of(o, z_ListStatus, &(*p)->bulkStatuses,
+ &(*p)->num_bulkStatuses) || odr_ok(o)) &&
+ odr_implicit(o, odr_visiblestring, &(*p)->deleteMessage, ODR_CONTEXT,
+ 36, 1) &&
+#ifdef Z_95
+ z_OtherInformation(o, &(*p)->otherInfo, 1) &&
+#endif
+ odr_sequence_end(o);
+}
+
+/* ------------------------ SEGMENT SERVICE -------------- */
+
+int z_Segment(ODR o, Z_Segment **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1) &&
+ odr_implicit(o, odr_integer, &(*p)->numberOfRecordsReturned,
+ ODR_CONTEXT, 24, 0) &&
+ odr_implicit_settag(o, ODR_CONTEXT, 0) &&
+ odr_sequence_of(o, z_NamePlusRecord, &(*p)->segmentRecords,
+ &(*p)->num_segmentRecords) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1) &&
+ odr_sequence_end(o);
+}
+
+/* ------------------------ CLOSE SERVICE ---------------- */
+
+int z_Close(ODR o, Z_Close **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1) &&
+ odr_implicit(o, odr_integer, &(*p)->closeReason, ODR_CONTEXT, 211, 0) &&
+ odr_implicit(o, odr_visiblestring, &(*p)->diagnosticInformation,
+ ODR_CONTEXT, 3, 1) &&
+ odr_implicit(o, odr_oid, &(*p)->resourceReportFormat, ODR_CONTEXT,
+ 4, 1) &&
+ odr_implicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT,
+ 5, 1) &&
+#ifdef Z_95
+ z_OtherInformation(o, &(*p)->otherInfo, 1) &&
+#endif
+ odr_sequence_end(o);
+}
+
+/* ------------------------ APDU ------------------------- */
+
+int z_Permissions(ODR o, Z_Permissions **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ odr_implicit(o, z_InternationalString, &(*p)->userId, ODR_CONTEXT,
+ 1, 0) &&
+ odr_implicit_settag(o, ODR_CONTEXT, 2) &&
+ odr_sequence_of(o, odr_integer, &(*p)->allowableFunctions,
+ &(*p)->num_allowableFunctions) &&
+ odr_sequence_end(o);
+}
+
+int z_ExtendedServicesRequest(ODR o, Z_ExtendedServicesRequest **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1) &&
+ odr_implicit(o, odr_integer, &(*p)->function, ODR_CONTEXT, 3, 0) &&
+ odr_implicit(o, odr_oid, &(*p)->packageType, ODR_CONTEXT, 4, 0) &&
+ odr_implicit(o, z_InternationalString, &(*p)->packageName, ODR_CONTEXT, 5, 1) &&
+ odr_implicit(o, z_InternationalString, &(*p)->userId, ODR_CONTEXT, 6, 1) &&
+ odr_implicit(o, z_IntUnit, &(*p)->retentionTime, ODR_CONTEXT, 7, 1) &&
+ odr_implicit(o, z_Permissions, &(*p)->permissions, ODR_CONTEXT, 8, 1) &&
+ odr_implicit(o, z_InternationalString, &(*p)->description, ODR_CONTEXT, 9, 1) &&
+ odr_implicit(o, z_External, &(*p)->taskSpecificParameters, ODR_CONTEXT, 10, 1) &&
+ odr_implicit(o, odr_integer, &(*p)->waitAction, ODR_CONTEXT, 11, 0) &&
+ z_ElementSetName(o, &(*p)->elements, 1) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1) &&
+ odr_sequence_end(o);
+}
+
+int z_ExtendedServicesResponse(ODR o, Z_ExtendedServicesResponse **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1) &&
+ odr_implicit(o, odr_integer, &(*p)->operationStatus, ODR_CONTEXT, 3, 0) &&
+ odr_implicit_settag(o, ODR_CONTEXT, 4) &&
+ (odr_sequence_of(o, z_DiagRec, &(*p)->diagnostics,
+ &(*p)->num_diagnostics) || odr_ok(o)) &&
+ odr_implicit(o, z_External, &(*p)->taskPackage, ODR_CONTEXT, 5, 1) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1) &&
+ odr_sequence_end(o);
+}
+
+/* ------------------------ SORT ------------------------- */
+
+int z_SortAttributes(ODR o, Z_SortAttributes **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ odr_oid(o, &(*p)->id, 0) &&
+ z_AttributeList(o, &(*p)->list, 0) &&
+ odr_sequence_end(o);
+}
+
+int z_SortKey(ODR o, Z_SortKey **p, int opt)
+{
+ static Odr_arm arm[] =
+ {
+ {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKey_sortField,
+ z_InternationalString},
+ {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKey_elementSpec, z_Specification},
+ {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKey_sortAttributes,
+ z_SortAttributes},
+ {-1, -1, -1, -1, 0}
+ };
+
+ if (!odr_initmember(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+int z_SortDbSpecific(ODR o, Z_SortDbSpecific **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_DatabaseName(o, &(*p)->databaseName, 0) &&
+ z_SortKey(o, &(*p)->dbSort, 0) &&
+ odr_sequence_end(o);
+}
+
+int z_SortDbSpecificList(ODR o, Z_SortDbSpecificList **p, int opt)
+{
+ if (!odr_initmember(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_sequence_of(o, z_SortDbSpecific, &(*p)->dbSpecific,
+ &(*p)->num_dbSpecific))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+int z_SortElement(ODR o, Z_SortElement **p, int opt)
+{
+ static Odr_arm arm[] =
+ {
+ {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_SortElement_generic, z_SortKey},
+ {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortElement_databaseSpecific,
+ z_SortDbSpecificList},
+ {-1, -1, -1, -1, 0}
+ };
+
+ if (!odr_initmember(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+int z_SortMissingValueAction(ODR o, Z_SortMissingValueAction **p, int opt)
+{
+ static Odr_arm arm[] =
+ {
+ {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortMissingValAct_abort, odr_null},
+ {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortMissingValAct_null, odr_null},
+ {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_SortMissingValAct_valData,
+ odr_octetstring},
+ {-1, -1, -1, -1, 0}
+ };
+
+ if (!odr_initmember(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+int z_SortKeySpec(ODR o, Z_SortKeySpec **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_SortElement(o, &(*p)->sortElement, 0) &&
+ odr_implicit(o, odr_integer, &(*p)->sortRelation, ODR_CONTEXT, 1, 0) &&
+ odr_implicit(o, odr_integer, &(*p)->caseSensitivity, ODR_CONTEXT,
+ 2, 0) &&
+ odr_explicit(o, z_SortMissingValueAction, &(*p)->missingValueAction,
+ ODR_CONTEXT, 3, 1) &&
+ odr_sequence_end(o);
+}
+
+int z_SortResponse(ODR o, Z_SortResponse **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1) &&
+ odr_implicit(o, odr_integer, &(*p)->sortStatus, ODR_CONTEXT,
+ 3, 0) &&
+ odr_implicit(o, odr_integer, &(*p)->resultSetStatus, ODR_CONTEXT,
+ 4, 1) &&
+ odr_implicit(o, z_DiagRecs, &(*p)->diagnostics, ODR_CONTEXT, 5, 1) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1) &&
+ odr_sequence_end(o);
+}
+
+int z_SortKeySpecList(ODR o, Z_SortKeySpecList **p, int opt)
+{
+ if (!odr_initmember(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_sequence_of(o, z_SortKeySpec, &(*p)->specs, &(*p)->num_specs))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+int z_SortRequest(ODR o, Z_SortRequest **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1) &&
+ odr_implicit(o, z_StringList, &(*p)->inputResultSetNames,
+ ODR_CONTEXT, 3, 0) &&
+ odr_implicit(o, z_InternationalString, &(*p)->sortedResultSetName,
+ ODR_CONTEXT, 4, 0) &&
+ odr_implicit(o, z_SortKeySpecList, &(*p)->sortSequence, ODR_CONTEXT,
+ 5, 0) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1) &&
+ odr_sequence_end(o);
+}
+
+/* ---------------------- Resource Report ---------------- */
+
+int z_ResourceReportRequest(ODR o, Z_ResourceReportRequest **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1) &&
+ odr_implicit(o, z_ReferenceId, &(*p)->opId, ODR_CONTEXT, 210, 1) &&
+ odr_implicit(o, odr_oid, &(*p)->prefResourceReportFormat, ODR_CONTEXT,
+ 49, 1) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1) &&
+ odr_sequence_end(o);
+}
+
+int z_ResourceReportResponse(ODR o, Z_ResourceReportResponse **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1) &&
+ odr_implicit(o, odr_integer, &(*p)->resourceReportStatus,
+ ODR_CONTEXT, 50, 0) &&
+ odr_explicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT,
+ 51, 1) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1) &&
+ odr_sequence_end(o);
+}
+