+/* ------------------ RESOURCE CONTROL ----------------*/
+
+typedef struct Z_TriggerResourceControlRequest
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int *requestedAction;
+#define Z_TriggerResourceCtrl_resourceReport 1
+#define Z_TriggerResourceCtrl_resourceControl 2
+#define Z_TriggerResourceCtrl_cancel 3
+ Odr_oid *prefResourceReportFormat; /* OPTIONAL */
+ bool_t *resultSetWanted; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo;
+#endif
+} Z_TriggerResourceControlRequest;
+
+typedef struct Z_ResourceControlRequest
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ bool_t *suspendedFlag; /* OPTIONAL */
+ Z_External *resourceReport; /* OPTIONAL */
+ int *partialResultsAvailable; /* OPTIONAL */
+#define Z_ResourceControlRequest_subset 1
+#define Z_ResourceControlRequest_interim 2
+#define Z_ResourceControlRequest_none 3
+ bool_t *responseRequired;
+ bool_t *triggeredRequestFlag; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo;
+#endif
+} Z_ResourceControlRequest;
+
+typedef struct Z_ResourceControlResponse
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ bool_t *continueFlag;
+ bool_t *resultSetWanted; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo;
+#endif
+} Z_ResourceControlResponse;
+
+
+/* ------------------ ACCESS CTRL SERVICE ----------------*/
+
+typedef struct Z_AccessControlRequest
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int which;
+#define Z_AccessRequest_simpleForm 0
+#define Z_AccessRequest_externallyDefined 1
+ union
+ {
+ Odr_oct *simpleForm;
+ Z_External *externallyDefined;
+ } u;
+#ifdef Z_95
+ Z_OtherInformation *otherInfo; /* OPTIONAL */
+#endif
+} Z_AccessControlRequest;
+
+typedef struct Z_AccessControlResponse
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int which;
+#define Z_AccessResponse_simpleForm 0
+#define Z_AccessResponse_externallyDefined 1
+ union
+ {
+ Odr_oct *simpleForm;
+ Z_External *externallyDefined;
+ } u;
+ Z_DiagRec *diagnostic; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo; /* OPTIONAL */
+#endif
+} Z_AccessControlResponse;
+
+/* ------------------------ SCAN SERVICE -------------------- */
+
+typedef struct Z_AttributeList
+{
+ int num_attributes;
+ Z_AttributeElement **attributes;
+} Z_AttributeList;
+
+typedef struct Z_AlternativeTerm
+{
+ int num_terms;
+ Z_AttributesPlusTerm **terms;
+} Z_AlternativeTerm;
+
+#if 1
+
+typedef struct Z_ByDatabase
+{
+ char *db;
+ int *num; /* OPTIONAL */
+ Z_OtherInformation *otherDbInfo; /* OPTIONAL */
+} Z_ByDatabase;
+
+typedef struct Z_ByDatabaseList
+{
+ int num_elements;
+ Z_ByDatabase **elements;
+} Z_ByDatabaseList;
+
+typedef struct Z_ScanOccurrences
+{
+ int which;
+#define Z_ScanOccurrences_global 0
+#define Z_ScanOccurrences_byDatabase 1
+ union
+ {
+ int *global;
+ Z_ByDatabaseList *byDatabase;
+ } u;
+
+} Z_ScanOccurrences;
+
+typedef struct Z_OccurrenceByAttributesElem
+{
+ Z_AttributeList *attributes;
+ Z_ScanOccurrences *occurrences; /* OPTIONAL */
+ Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
+} Z_OccurrenceByAttributesElem;
+
+typedef struct Z_OccurrenceByAttributes
+{
+ int num_elements;
+ Z_OccurrenceByAttributesElem **elements;
+} Z_OccurrenceByAttributes;
+
+#else
+
+/*
+ * Old, incomplete definition of OccurrenceByAttributes.
+ */
+
+typedef struct Z_OccurrenceByAttributes
+{
+ Z_AttributeList *attributes;
+#if 0
+ int which;
+#define Z_OByAtt_global 0
+#define Z_ObyAtt_byDatabase 1
+ union
+ {
+#endif
+ int *global;
+#if 0
+ /* Z_ByDatabase *byDatabase; */
+ } u;
+#endif
+} Z_OccurrenceByAttributes;
+
+#endif
+
+typedef struct Z_TermInfo
+{
+ Z_Term *term;
+ char *displayTerm; /* OPTIONAL */
+ Z_AttributeList *suggestedAttributes; /* OPTIONAL */
+ Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
+ int *globalOccurrences; /* OPTIONAL */
+ Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
+ Z_OtherInformation *otherTermInfo; /* OPTIONAL */
+} Z_TermInfo;
+
+typedef struct Z_Entry
+{
+ int which;
+#define Z_Entry_termInfo 0
+#define Z_Entry_surrogateDiagnostic 1
+ union
+ {
+ Z_TermInfo *termInfo;
+ Z_DiagRec *surrogateDiagnostic;
+ } u;
+} Z_Entry;
+
+typedef struct Z_Entries
+{
+ int num_entries;
+ Z_Entry **entries;
+} Z_Entries;
+
+typedef struct Z_ListEntries
+{
+ int which;
+#define Z_ListEntries_entries 0
+#define Z_ListEntries_nonSurrogateDiagnostics 1
+ union
+ {
+ Z_Entries *entries;
+ Z_DiagRecs *nonSurrogateDiagnostics;
+ } u;
+} Z_ListEntries;
+
+typedef struct Z_ScanRequest
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int num_databaseNames;
+ char **databaseNames;
+ Odr_oid *attributeSet; /* OPTIONAL */
+ Z_AttributesPlusTerm *termListAndStartPoint;
+ int *stepSize; /* OPTIONAL */
+ int *numberOfTermsRequested;
+ int *preferredPositionInResponse; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo;
+#endif
+} Z_ScanRequest;
+
+typedef struct Z_ScanResponse
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int *stepSize; /* OPTIONAL */
+ int *scanStatus;
+#define Z_Scan_success 0
+#define Z_Scan_partial_1 1
+#define Z_Scan_partial_2 2
+#define Z_Scan_partial_3 3
+#define Z_Scan_partial_4 4
+#define Z_Scan_partial_5 5
+#define Z_Scan_failure 6
+ int *numberOfEntriesReturned;
+ int *positionOfTerm; /* OPTIONAL */
+ Z_ListEntries *entries; /* OPTIONAL */
+ Odr_oid *attributeSet; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo;
+#endif
+} Z_ScanResponse;
+
+
+/* ------------------------ DELETE -------------------------- */
+
+#define Z_DeleteStatus_success 0
+#define Z_DeleteStatus_resultSetDidNotExist 1
+#define Z_DeleteStatus_previouslyDeletedByTarget 2
+#define Z_DeleteStatus_systemProblemAtTarget 3
+#define Z_DeleteStatus_accessNotAllowed 4
+#define Z_DeleteStatus_resourceControlAtOrigin 5
+#define Z_DeleteStatus_resourceControlAtTarget 6
+#define Z_DeleteStatus_bulkDeleteNotSupported 7
+#define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
+#define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
+#define Z_DeleteStatus_resultSetInUse 10
+
+typedef struct Z_ListStatus
+{
+ Z_ResultSetId *id;
+ int *status;
+} Z_ListStatus;
+
+typedef struct Z_DeleteResultSetRequest
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int *deleteFunction;
+#define Z_DeleteRequest_list 0
+#define Z_DeleteRequest_all 1
+ int num_ids;
+ Z_ResultSetId **resultSetList; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo;
+#endif
+} Z_DeleteResultSetRequest;
+
+typedef struct Z_DeleteResultSetResponse
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int *deleteOperationStatus;
+ int num_statuses;
+ Z_ListStatus **deleteListStatuses; /* OPTIONAL */
+ int *numberNotDeleted; /* OPTIONAL */
+ int num_bulkStatuses;
+ Z_ListStatus **bulkStatuses; /* OPTIONAL */
+ char *deleteMessage; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo;
+#endif
+} Z_DeleteResultSetResponse;
+
+/* ------------------------ CLOSE SERVICE ------------------- */
+
+typedef struct Z_Close
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int *closeReason;
+#define Z_Close_finished 0
+#define Z_Close_shutdown 1
+#define Z_Close_systemProblem 2
+#define Z_Close_costLimit 3
+#define Z_Close_resources 4
+#define Z_Close_securityViolation 5
+#define Z_Close_protocolError 6
+#define Z_Close_lackOfActivity 7
+#define Z_Close_peerAbort 8
+#define Z_Close_unspecified 9
+ char *diagnosticInformation; /* OPTIONAL */
+ Odr_oid *resourceReportFormat; /* OPTIONAL */
+ Z_External *resourceReport; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo; /* OPTIONAL */
+#endif
+} Z_Close;
+
+/* ------------------------ SEGMENTATION -------------------- */
+
+typedef struct Z_Segment
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int *numberOfRecordsReturned;
+ int num_segmentRecords;
+ Z_NamePlusRecord **segmentRecords;
+ Z_OtherInformation *otherInfo; /* OPTIONAL */
+} Z_Segment;
+
+/* ----------------------- Extended Services ---------------- */
+
+typedef struct Z_Permissions
+{
+ char *userId;
+ int num_allowableFunctions;
+ int **allowableFunctions;
+#define Z_Permissions_delete 1
+#define Z_Permissions_modifyContents 2
+#define Z_Permissions_modifyPermissions 3
+#define Z_Permissions_present 4
+#define Z_Permissions_invoke 5
+} Z_Permissions;
+
+typedef struct Z_ExtendedServicesRequest
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int *function;
+#define Z_ExtendedServicesRequest_create 1
+#define Z_ExtendedServicesRequest_delete 2
+#define Z_ExtendedServicesRequest_modify 3
+ Odr_oid *packageType;
+ char *packageName; /* OPTIONAL */
+ char *userId; /* OPTIONAL */
+ Z_IntUnit *retentionTime; /* OPTIONAL */
+ Z_Permissions *permissions; /* OPTIONAL */
+ char *description; /* OPTIONAL */
+ Z_External *taskSpecificParameters; /* OPTIONAL */
+ int *waitAction;
+#define Z_ExtendedServicesRequest_wait 1
+#define Z_ExtendedServicesRequest_waitIfPossible 2
+#define Z_ExtendedServicesRequest_dontWait 3
+#define Z_ExtendedServicesRequest_dontReturnPackage 4
+ char *elements; /* OPTIONAL */
+ Z_OtherInformation *otherInfo; /* OPTIONAL */
+} Z_ExtendedServicesRequest;
+
+typedef struct Z_ExtendedServicesResponse
+{
+ Z_ReferenceId *referenceId; /* OPTIONAL */
+ int *operationStatus;
+#define Z_ExtendedServicesResponse_done 1
+#define Z_ExtendedServicesResponse_accepted 2
+#define Z_ExtendedServicesResponse_failure 3
+ int num_diagnostics;
+ Z_DiagRec **diagnostics; /* OPTIONAL */
+ Z_External *taskPackage; /* OPTIONAL */
+ Z_OtherInformation *otherInfo; /* OPTIONAL */
+} Z_ExtendedServicesResponse;
+
+/* ------------------------ 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;
+