+/* ------------------------ Sort --------------------------- */
+
+typedef struct Z_SortAttributes
+{
+ Odr_oid *id;
+ Z_AttributeList *list;
+} Z_SortAttributes;
+
+typedef struct Z_SortKey
+{
+ int which;
+#define Z_SortKey_sortField 0
+#define Z_SortKey_elementSpec 1
+#define Z_SortKey_sortAttributes 2
+ union
+ {
+ char *sortField;
+ Z_Specification *elementSpec;
+ Z_SortAttributes *sortAttributes;
+ } u;
+} Z_SortKey;
+
+typedef struct Z_SortDbSpecific
+{
+ char *databaseName;
+ Z_SortKey *dbSort;
+} Z_SortDbSpecific;
+
+typedef struct Z_SortDbSpecificList
+{
+ int num_dbSpecific;
+ Z_SortDbSpecific **dbSpecific;
+} Z_SortDbSpecificList;
+
+typedef struct Z_SortElement
+{
+ int which;
+#define Z_SortElement_generic 0
+#define Z_SortElement_databaseSpecific 1
+ union
+ {
+ Z_SortKey *generic;
+ Z_SortDbSpecificList *databaseSpecific;
+ } u;
+} Z_SortElement;
+
+typedef struct Z_SortMissingValueAction
+{
+ int which;
+#define Z_SortMissingValAct_abort 0
+#define Z_SortMissingValAct_null 1
+#define Z_SortMissingValAct_valData 2
+ union
+ {
+ Odr_null *abort;
+ Odr_null *null;
+ Odr_oct *valData;
+ } u;
+} Z_SortMissingValueAction;
+
+typedef struct Z_SortKeySpec
+{
+ Z_SortElement *sortElement;
+ int *sortRelation;
+#define Z_SortRelation_ascending 0
+#define Z_SortRelation_descending 1
+#define Z_SortRelation_ascendingByFreq 3
+#define Z_SortRelation_descendingByFreq 4
+ int *caseSensitivity;
+#define Z_SortCase_caseSensitive 0
+#define Z_SortCase_caseInsensitive 1
+ Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
+} Z_SortKeySpec;
+
+typedef struct Z_SortResponse
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int *sortStatus;
+#define Z_SortStatus_success 0
+#define Z_SortStatus_partial_1 1
+#define Z_SortStatus_failure 2
+ int *resultSetStatus; /* OPTIONAL */
+#define Z_SortResultSetStatus_empty 1
+#define Z_SortResultSetStatus_interim 2
+#define Z_SortResultSetStatus_unchanged 3
+#define Z_SortResultSetStatus_none 4
+ Z_DiagRecs *diagnostics; /* OPTIONAL */
+ Z_OtherInformation *otherInfo; /* OPTIONAL */
+} Z_SortResponse;
+
+typedef struct Z_SortKeySpecList
+{
+ int num_specs;
+ Z_SortKeySpec **specs;
+} Z_SortKeySpecList;
+
+typedef struct Z_SortRequest
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ Z_StringList *inputResultSetNames;
+ char *sortedResultSetName;
+ Z_SortKeySpecList *sortSequence;
+ Z_OtherInformation *otherInfo; /* OPTIONAL */
+} Z_SortRequest;
+
+/* ----------------------- Resource Report ------------------ */
+
+typedef struct Z_ResourceReportRequest
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ Z_ReferenceId *opId; /* OPTIONAL */
+ Odr_oid *prefResourceReportFormat; /* OPTIONAL */
+ Z_OtherInformation *otherInfo; /* OPTIONAL */
+} Z_ResourceReportRequest;
+
+typedef struct Z_ResourceReportResponse
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int *resourceReportStatus;
+#define Z_ResourceReportStatus_success 0
+#define Z_ResourceReportStatus_partial 1
+#define Z_ResourceReportStatus_failure_1 2
+#define Z_ResourceReportStatus_failure_2 3
+#define Z_ResourceReportStatus_failure_3 4
+#define Z_ResourceReportStatus_failure_4 5
+#define Z_ResourceReportStatus_failure_5 6
+#define Z_ResourceReportStatus_failure_6 7
+ Z_External *resourceReport; /* OPTIONAL */
+ Z_OtherInformation *otherInfo; /* OPTIONAL */
+} Z_ResourceReportResponse;
+