2 * Copyright (c) 1995, Index Data.
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation, in whole or in part, for any purpose, is hereby granted,
8 * 1. This copyright and permission notice appear in all copies of the
9 * software and its documentation. Notices of copyright or attribution
10 * which appear at the beginning of any file must remain unchanged.
12 * 2. The name of Index Data or the individual authors may not be used to
13 * endorse or promote products derived from this software without specific
14 * prior written permission.
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19 * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20 * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
21 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
22 * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
27 * Revision 1.33 1996-02-23 10:00:51 quinn
30 * Revision 1.32 1996/02/20 12:52:39 quinn
33 * Revision 1.31 1996/01/22 09:46:45 quinn
34 * Added Sort PDU. Moved StringList to main protocol file.
36 * Revision 1.30 1996/01/10 15:21:32 quinn
37 * Added links to access control PDUs
39 * Revision 1.29 1996/01/02 11:46:49 quinn
40 * Changed 'operator' to 'roperator' to avoid C++ conflict.
43 * Revision 1.28 1996/01/02 08:57:32 quinn
44 * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
46 * Revision 1.27 1995/10/12 10:34:46 quinn
49 * Revision 1.26 1995/09/29 17:12:08 quinn
52 * Revision 1.25 1995/09/27 15:02:49 quinn
53 * Modified function heads & prototypes.
55 * Revision 1.24 1995/08/29 11:17:43 quinn
56 * *** empty log message ***
58 * Revision 1.23 1995/08/21 09:10:36 quinn
59 * Smallish fixes to suppport new formats.
61 * Revision 1.22 1995/08/17 12:45:14 quinn
62 * Fixed minor problems with GRS-1. Added support in c&s.
64 * Revision 1.21 1995/08/15 12:00:11 quinn
67 * Revision 1.20 1995/08/10 08:54:35 quinn
70 * Revision 1.19 1995/06/19 12:38:28 quinn
71 * Reorganized include-files. Added small features.
73 * Revision 1.18 1995/06/16 13:16:05 quinn
74 * Fixed Defaultdiagformat.
76 * Revision 1.17 1995/06/15 15:42:05 quinn
79 * Revision 1.16 1995/06/15 07:45:06 quinn
82 * Revision 1.15 1995/06/14 15:26:43 quinn
83 * *** empty log message ***
85 * Revision 1.14 1995/06/07 14:42:34 quinn
88 * Revision 1.13 1995/06/07 14:36:47 quinn
91 * Revision 1.12 1995/06/05 10:53:13 quinn
94 * Revision 1.11 1995/06/02 09:49:47 quinn
97 * Revision 1.10 1995/05/29 08:11:34 quinn
98 * Moved oid from odr/asn to util.
100 * Revision 1.9 1995/05/22 11:31:25 quinn
103 * Revision 1.8 1995/05/17 08:41:35 quinn
104 * Added delete to proto & other little things.
105 * Relaying auth info to backend.
107 * Revision 1.7 1995/05/16 08:50:37 quinn
108 * License, documentation, and memory fixes
110 * Revision 1.6 1995/05/15 11:55:55 quinn
111 * Work on asynchronous activity.
113 * Revision 1.5 1995/04/17 11:28:18 quinn
116 * Revision 1.4 1995/04/10 10:22:47 quinn
119 * Revision 1.3 1995/03/30 12:18:09 quinn
122 * Revision 1.2 1995/03/30 10:26:48 quinn
123 * Added Term structure
125 * Revision 1.1 1995/03/30 09:39:42 quinn
126 * Moved .h files to include directory
128 * Revision 1.11 1995/03/30 09:08:44 quinn
129 * Added Resource control protocol
131 * Revision 1.10 1995/03/29 15:39:39 quinn
132 * Adding some resource control elements, and a null-check to getentbyoid
134 * Revision 1.9 1995/03/29 08:06:18 quinn
135 * Added a few v3 elements
137 * Revision 1.8 1995/03/22 10:12:49 quinn
138 * Added Z_PRES constants.
140 * Revision 1.7 1995/03/20 09:45:12 quinn
143 * Revision 1.5 1995/03/07 16:29:34 quinn
144 * Added authentication stuff.
146 * Revision 1.4 1995/03/07 10:13:00 quinn
147 * Added prototype for z_APDU()
149 * Revision 1.3 1995/02/14 11:54:23 quinn
152 * Revision 1.2 1995/02/09 15:51:40 quinn
155 * Revision 1.1 1995/02/06 16:44:48 quinn
156 * First hack at Z/SR protocol
167 #include <yaz-version.h>
170 * Because we didn't have time to put all of the extra v3 elements in here
171 * before the first applications were written, we have to place them
172 * in #ifdefs in places where they would break existing code. If you are
173 * developing new stuff, we urge you to leave them in, even if you don't
174 * intend to use any v3 features. When we are comfortable that the old
175 * apps have been updated, we'll remove the #ifdefs.
180 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
183 typedef struct Z_External Z_External;
185 typedef Odr_oct Z_ReferenceId;
186 typedef char Z_DatabaseName;
187 typedef char Z_ResultSetId;
188 typedef Odr_oct Z_ResultsetId;
190 typedef struct Z_InfoCategory
192 Odr_oid *categoryTypeId; /* OPTIONAL */
196 typedef struct Z_OtherInformationUnit
198 Z_InfoCategory *category; /* OPTIONAL */
200 #define Z_OtherInfo_characterInfo 0
201 #define Z_OtherInfo_binaryInfo 1
202 #define Z_OtherInfo_externallyDefinedInfo 2
203 #define Z_OtherInfo_oid 3
208 Z_External *externallyDefinedInfo;
211 } Z_OtherInformationUnit;
213 typedef struct Z_OtherInformation
216 Z_OtherInformationUnit **list;
217 } Z_OtherInformation;
219 typedef struct Z_StringOrNumeric
222 #define Z_StringOrNumeric_string 0
223 #define Z_StringOrNumeric_numeric 1
231 typedef struct Z_Unit
233 char *unitSystem; /* OPTIONAL */
234 Z_StringOrNumeric *unitType; /* OPTIONAL */
235 Z_StringOrNumeric *unit; /* OPTIONAL */
236 int *scaleFactor; /* OPTIONAL */
239 typedef struct Z_IntUnit
245 typedef Odr_oct Z_SUTRS;
247 typedef struct Z_StringList
253 /* ----------------- INIT SERVICE ----------------*/
257 char *groupId; /* OPTIONAL */
258 char *userId; /* OPTIONAL */
259 char *password; /* OPTIONAL */
262 typedef struct Z_IdAuthentication
265 #define Z_IdAuthentication_open 0
266 #define Z_IdAuthentication_idPass 1
267 #define Z_IdAuthentication_anonymous 2
268 #define Z_IdAuthentication_other 3
276 } Z_IdAuthentication;
278 #define Z_ProtocolVersion_1 0
279 #define Z_ProtocolVersion_2 1
280 #define Z_ProtocolVersion_3 2
282 #define Z_Options_search 0
283 #define Z_Options_present 1
284 #define Z_Options_delSet 2
285 #define Z_Options_resourceReport 3
286 #define Z_Options_triggerResourceCtrl 4
287 #define Z_Options_resourceCtrl 5
288 #define Z_Options_accessCtrl 6
289 #define Z_Options_scan 7
290 #define Z_Options_sort 8
291 #define Z_Options_reserved 9
292 #define Z_Options_extendedServices 10
293 #define Z_Options_level_1Segmentation 11
294 #define Z_Options_level_2Segmentation 12
295 #define Z_Options_concurrentOperations 13
296 #define Z_Options_namedResultSets 14
298 typedef struct Z_InitRequest
300 Z_ReferenceId *referenceId; /* OPTIONAL */
301 Odr_bitmask *protocolVersion;
302 Odr_bitmask *options;
303 int *preferredMessageSize;
304 int *maximumRecordSize;
305 Z_IdAuthentication* idAuthentication; /* OPTIONAL */
306 char *implementationId; /* OPTIONAL */
307 char *implementationName; /* OPTIONAL */
308 char *implementationVersion; /* OPTIONAL */
309 Z_External *userInformationField; /* OPTIONAL */
311 Z_OtherInformation *otherInfo; /* OPTIONAL */
315 typedef struct Z_InitResponse
317 Z_ReferenceId *referenceId; /* OPTIONAL */
318 Odr_bitmask *protocolVersion;
319 Odr_bitmask *options;
320 int *preferredMessageSize;
321 int *maximumRecordSize;
323 char *implementationId; /* OPTIONAL */
324 char *implementationName; /* OPTIONAL */
325 char *implementationVersion; /* OPTIONAL */
326 Z_External *userInformationField; /* OPTIONAL */
328 Z_OtherInformation *otherInfo; /* OPTIONAL */
332 typedef struct Z_NSRAuthentication
337 } Z_NSRAuthentication;
339 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
341 int z_StrAuthentication(ODR o, char **p, int opt);
343 /* ------------------ SEARCH SERVICE ----------------*/
345 typedef struct Z_DatabaseSpecificUnit
348 char *elementSetName;
349 } Z_DatabaseSpecificUnit;
351 typedef struct Z_DatabaseSpecific
354 Z_DatabaseSpecificUnit **elements;
355 } Z_DatabaseSpecific;
357 typedef struct Z_ElementSetNames
360 #define Z_ElementSetNames_generic 0
361 #define Z_ElementSetNames_databaseSpecific 1
365 Z_DatabaseSpecific *databaseSpecific;
369 /* ---------------------- RPN QUERY --------------------------- */
371 typedef struct Z_ComplexAttribute
374 Z_StringOrNumeric **list;
375 int num_semanticAction;
376 int **semanticAction; /* OPTIONAL */
377 } Z_ComplexAttribute;
379 typedef struct Z_AttributeElement
382 Odr_oid *attributeSet; /* OPTIONAL - v3 only */
387 #define Z_AttributeValue_numeric 0
388 #define Z_AttributeValue_complex 1
392 Z_ComplexAttribute *complex;
397 } Z_AttributeElement;
399 typedef struct Z_Term
402 #define Z_Term_general 0
403 #define Z_Term_numeric 1
404 #define Z_Term_characterString 2
406 #define Z_Term_dateTime 4
407 #define Z_Term_external 5
408 #define Z_Term_integerAndUnit 6
409 #define Z_Term_null 7
412 Odr_oct *general; /* this is required for v2 */
414 char *characterString;
417 Z_External *external;
418 /* Z_IntUnit *integerAndUnit; */
423 typedef struct Z_AttributesPlusTerm
426 Z_AttributeElement **attributeList;
428 } Z_AttributesPlusTerm;
430 typedef struct Z_ResultSetPlusAttributes
434 Z_AttributeElement **attributeList;
435 } Z_ResultSetPlusAttributes;
437 typedef struct Z_ProximityOperator
439 bool_t *exclusion; /* OPTIONAL */
443 #define Z_Prox_lessThan 1
444 #define Z_Prox_lessThanOrEqual 2
445 #define Z_Prox_equal 3
446 #define Z_Prox_greaterThanOrEqual 4
447 #define Z_Prox_greaterThan 5
448 #define Z_Prox_notEqual 6
450 #define Z_ProxCode_known 0
451 #define Z_ProxCode_private 1
452 int *proximityUnitCode;
453 #define Z_ProxUnit_character 1
454 #define Z_ProxUnit_word 2
455 #define Z_ProxUnit_sentence 3
456 #define Z_ProxUnit_paragraph 4
457 #define Z_ProxUnit_section 5
458 #define Z_ProxUnit_chapter 6
459 #define Z_ProxUnit_document 7
460 #define Z_ProxUnit_element 8
461 #define Z_ProxUnit_subelement 9
462 #define Z_ProxUnit_elementType 10
463 #define Z_ProxUnit_byte 11 /* v3 only */
464 } Z_ProximityOperator;
466 typedef struct Z_Operator
469 #define Z_Operator_and 0
470 #define Z_Operator_or 1
471 #define Z_Operator_and_not 2
472 #define Z_Operator_prox 3
475 Odr_null *and; /* these guys are nulls. */
478 Z_ProximityOperator *prox;
482 typedef struct Z_Operand
485 #define Z_Operand_APT 0
486 #define Z_Operand_resultSetId 1
487 #define Z_Operand_resultAttr /* v3 only */ 2
490 Z_AttributesPlusTerm *attributesPlusTerm;
491 Z_ResultSetId *resultSetId;
492 Z_ResultSetPlusAttributes *resultAttr;
496 typedef struct Z_Complex
498 struct Z_RPNStructure *s1;
499 struct Z_RPNStructure *s2;
500 Z_Operator *roperator;
503 typedef struct Z_RPNStructure
506 #define Z_RPNStructure_simple 0
507 #define Z_RPNStructure_complex 1
515 typedef struct Z_RPNQuery
517 Odr_oid *attributeSetId;
518 Z_RPNStructure *RPNStructure;
521 /* -------------------------- SEARCHREQUEST -------------------------- */
523 typedef struct Z_Query
526 #define Z_Query_type_1 1
527 #define Z_Query_type_2 2
528 #define Z_Query_type_101 3
533 Z_RPNQuery *type_101;
537 typedef struct Z_SearchRequest
539 Z_ReferenceId *referenceId; /* OPTIONAL */
540 int *smallSetUpperBound;
541 int *largeSetLowerBound;
542 int *mediumSetPresentNumber;
543 bool_t *replaceIndicator;
545 int num_databaseNames;
546 char **databaseNames;
547 Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */
548 Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */
549 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
552 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */
553 Z_OtherInformation *otherInfo; /* OPTIONAL */
557 /* ------------------------ RECORD -------------------------- */
559 typedef Z_External Z_DatabaseRecord;
563 typedef struct Z_DefaultDiagFormat
565 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
567 /* until the whole character set issue becomes more definite,
568 * you can probably ignore this on input. */
570 #define Z_DiagForm_v2AddInfo 0
571 #define Z_DiagForm_v3AddInfo 1
573 } Z_DefaultDiagFormat;
575 typedef struct Z_DiagRec
578 #define Z_DiagRec_defaultFormat 0
579 #define Z_DiagRec_externallyDefined 1
582 Z_DefaultDiagFormat *defaultFormat;
583 Z_External *externallyDefined;
589 typedef struct Z_DiagRec
591 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
598 typedef struct Z_DiagRecs
601 Z_DiagRec **diagRecs;
604 typedef struct Z_NamePlusRecord
606 char *databaseName; /* OPTIONAL */
608 #define Z_NamePlusRecord_databaseRecord 0
609 #define Z_NamePlusRecord_surrogateDiagnostic 1
612 Z_DatabaseRecord *databaseRecord;
613 Z_DiagRec *surrogateDiagnostic;
617 typedef struct Z_NamePlusRecordList
620 Z_NamePlusRecord **records;
621 } Z_NamePlusRecordList;
623 typedef struct Z_Records
626 #define Z_Records_DBOSD 0
627 #define Z_Records_NSD 1
628 #define Z_Records_multipleNSD 2
631 Z_NamePlusRecordList *databaseOrSurDiagnostics;
632 Z_DiagRec *nonSurrogateDiagnostic;
633 Z_DiagRecs *multipleNonSurDiagnostics;
637 /* ------------------------ SEARCHRESPONSE ------------------ */
639 typedef struct Z_SearchResponse
641 Z_ReferenceId *referenceId; /* OPTIONAL */
643 int *numberOfRecordsReturned;
644 int *nextResultSetPosition;
645 bool_t *searchStatus;
646 int *resultSetStatus; /* OPTIONAL */
647 #define Z_RES_SUBSET 1
648 #define Z_RES_INTERIM 2
650 int *presentStatus; /* OPTIONAL */
651 #define Z_PRES_SUCCESS 0
652 #define Z_PRES_PARTIAL_1 1
653 #define Z_PRES_PARTIAL_2 2
654 #define Z_PRES_PARTIAL_3 3
655 #define Z_PRES_PARTIAL_4 4
656 #define Z_PRES_FAILURE 5
657 Z_Records *records; /* OPTIONAL */
659 Z_OtherInformation *additionalSearchInfo;
660 Z_OtherInformation *otherInfo;
664 /* ------------------------- PRESENT SERVICE -----------------*/
666 typedef struct Z_ElementSpec
669 #define Z_ElementSpec_elementSetName 0
670 #define Z_ElementSpec_externalSpec 1
673 char *elementSetName;
674 Z_External *externalSpec;
678 typedef struct Z_Specification
680 Odr_oid *schema; /* OPTIONAL */
681 Z_ElementSpec *elementSpec; /* OPTIONAL */
684 typedef struct Z_DbSpecific
687 Z_Specification *spec;
690 typedef struct Z_CompSpec
692 bool_t *selectAlternativeSyntax;
693 Z_Specification *generic; /* OPTIONAL */
695 Z_DbSpecific **dbSpecific; /* OPTIONAL */
696 int num_recordSyntax;
697 Odr_oid **recordSyntax; /* OPTIONAL */
700 typedef struct Z_RecordComposition
703 #define Z_RecordComp_simple 0
704 #define Z_RecordComp_complex 1
707 Z_ElementSetNames *simple;
710 } Z_RecordComposition;
712 typedef struct Z_Range
714 int *startingPosition;
715 int *numberOfRecords;
718 typedef struct Z_PresentRequest
720 Z_ReferenceId *referenceId; /* OPTIONAL */
721 Z_ResultSetId *resultSetId;
722 int *resultSetStartPoint;
723 int *numberOfRecordsRequested;
726 Z_Range **additionalRanges; /* OPTIONAL */
727 Z_RecordComposition *recordComposition; /* OPTIONAL */
729 Z_ElementSetNames *elementSetNames; /* OPTIONAL */
731 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
733 int *maxSegmentCount; /* OPTIONAL */
734 int *maxRecordSize; /* OPTIONAL */
735 int *maxSegmentSize; /* OPTIONAL */
736 Z_OtherInformation *otherInfo; /* OPTIONAL */
740 typedef struct Z_PresentResponse
742 Z_ReferenceId *referenceId; /* OPTIONAL */
743 int *numberOfRecordsReturned;
744 int *nextResultSetPosition;
748 Z_OtherInformation *otherInfo; /* OPTIONAL */
752 /* ------------------ RESOURCE CONTROL ----------------*/
754 typedef struct Z_TriggerResourceControlRequest
756 Z_ReferenceId *referenceId; /* OPTIONAL */
757 int *requestedAction;
758 #define Z_TriggerResourceCtrl_resourceReport 1
759 #define Z_TriggerResourceCtrl_resourceControl 2
760 #define Z_TriggerResourceCtrl_cancel 3
761 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
762 bool_t *resultSetWanted; /* OPTIONAL */
764 Z_OtherInformation *otherInfo;
766 } Z_TriggerResourceControlRequest;
768 typedef struct Z_ResourceControlRequest
770 Z_ReferenceId *referenceId; /* OPTIONAL */
771 bool_t *suspendedFlag; /* OPTIONAL */
772 Z_External *resourceReport; /* OPTIONAL */
773 int *partialResultsAvailable; /* OPTIONAL */
774 #define Z_ResourceControlRequest_subset 1
775 #define Z_ResourceControlRequest_interim 2
776 #define Z_ResourceControlRequest_none 3
777 bool_t *responseRequired;
778 bool_t *triggeredRequestFlag; /* OPTIONAL */
780 Z_OtherInformation *otherInfo;
782 } Z_ResourceControlRequest;
784 typedef struct Z_ResourceControlResponse
786 Z_ReferenceId *referenceId; /* OPTIONAL */
787 bool_t *continueFlag;
788 bool_t *resultSetWanted; /* OPTIONAL */
790 Z_OtherInformation *otherInfo;
792 } Z_ResourceControlResponse;
795 /* ------------------ ACCESS CTRL SERVICE ----------------*/
797 typedef struct Z_AccessControlRequest
799 Z_ReferenceId *referenceId; /* OPTIONAL */
801 #define Z_AccessRequest_simpleForm 0
802 #define Z_AccessRequest_externallyDefined 1
806 Z_External *externallyDefined;
809 Z_OtherInformation *otherInfo; /* OPTIONAL */
811 } Z_AccessControlRequest;
813 typedef struct Z_AccessControlResponse
815 Z_ReferenceId *referenceId; /* OPTIONAL */
817 #define Z_AccessResponse_simpleForm 0
818 #define Z_AccessResponse_externallyDefined 1
822 Z_External *externallyDefined;
824 Z_DiagRec *diagnostic; /* OPTIONAL */
826 Z_OtherInformation *otherInfo; /* OPTIONAL */
828 } Z_AccessControlResponse;
830 /* ------------------------ SCAN SERVICE -------------------- */
832 typedef struct Z_AttributeList
835 Z_AttributeElement **attributes;
838 typedef struct Z_AlternativeTerm
841 Z_AttributesPlusTerm **terms;
846 typedef struct Z_ByDatabase
849 int *num; /* OPTIONAL */
850 Z_OtherInformation *otherDbInfo; /* OPTIONAL */
853 typedef struct Z_ByDatabaseList
856 Z_ByDatabase **elements;
859 typedef struct Z_ScanOccurrences
862 #define Z_ScanOccurrences_global 0
863 #define Z_ScanOccurrences_byDatabase 1
867 Z_ByDatabaseList *byDatabase;
872 typedef struct Z_OccurrenceByAttributesElem
874 Z_AttributeList *attributes;
875 Z_ScanOccurrences *occurrences; /* OPTIONAL */
876 Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
877 } Z_OccurrenceByAttributesElem;
879 typedef struct Z_OccurrenceByAttributes
882 Z_OccurrenceByAttributesElem **elements;
883 } Z_OccurrenceByAttributes;
888 * Old, incomplete definition of OccurrenceByAttributes.
891 typedef struct Z_OccurrenceByAttributes
893 Z_AttributeList *attributes;
896 #define Z_OByAtt_global 0
897 #define Z_ObyAtt_byDatabase 1
903 /* Z_ByDatabase *byDatabase; */
906 } Z_OccurrenceByAttributes;
910 typedef struct Z_TermInfo
913 char *displayTerm; /* OPTIONAL */
914 Z_AttributeList *suggestedAttributes; /* OPTIONAL */
915 Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
916 int *globalOccurrences; /* OPTIONAL */
917 Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
918 Z_OtherInformation *otherTermInfo; /* OPTIONAL */
921 typedef struct Z_Entry
924 #define Z_Entry_termInfo 0
925 #define Z_Entry_surrogateDiagnostic 1
928 Z_TermInfo *termInfo;
929 Z_DiagRec *surrogateDiagnostic;
933 typedef struct Z_Entries
939 typedef struct Z_ListEntries
942 #define Z_ListEntries_entries 0
943 #define Z_ListEntries_nonSurrogateDiagnostics 1
947 Z_DiagRecs *nonSurrogateDiagnostics;
951 typedef struct Z_ScanRequest
953 Z_ReferenceId *referenceId; /* OPTIONAL */
954 int num_databaseNames;
955 char **databaseNames;
956 Odr_oid *attributeSet; /* OPTIONAL */
957 Z_AttributesPlusTerm *termListAndStartPoint;
958 int *stepSize; /* OPTIONAL */
959 int *numberOfTermsRequested;
960 int *preferredPositionInResponse; /* OPTIONAL */
962 Z_OtherInformation *otherInfo;
966 typedef struct Z_ScanResponse
968 Z_ReferenceId *referenceId; /* OPTIONAL */
969 int *stepSize; /* OPTIONAL */
971 #define Z_Scan_success 0
972 #define Z_Scan_partial_1 1
973 #define Z_Scan_partial_2 2
974 #define Z_Scan_partial_3 3
975 #define Z_Scan_partial_4 4
976 #define Z_Scan_partial_5 5
977 #define Z_Scan_failure 6
978 int *numberOfEntriesReturned;
979 int *positionOfTerm; /* OPTIONAL */
980 Z_ListEntries *entries; /* OPTIONAL */
981 Odr_oid *attributeSet; /* OPTIONAL */
983 Z_OtherInformation *otherInfo;
988 /* ------------------------ DELETE -------------------------- */
990 #define Z_DeleteStatus_success 0
991 #define Z_DeleteStatus_resultSetDidNotExist 1
992 #define Z_DeleteStatus_previouslyDeletedByTarget 2
993 #define Z_DeleteStatus_systemProblemAtTarget 3
994 #define Z_DeleteStatus_accessNotAllowed 4
995 #define Z_DeleteStatus_resourceControlAtOrigin 5
996 #define Z_DeleteStatus_resourceControlAtTarget 6
997 #define Z_DeleteStatus_bulkDeleteNotSupported 7
998 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
999 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
1000 #define Z_DeleteStatus_resultSetInUse 10
1002 typedef struct Z_ListStatus
1008 typedef struct Z_DeleteResultSetRequest
1010 Z_ReferenceId *referenceId; /* OPTIONAL */
1011 int *deleteFunction;
1012 #define Z_DeleteRequest_list 0
1013 #define Z_DeleteRequest_all 1
1015 Z_ResultSetId **resultSetList; /* OPTIONAL */
1017 Z_OtherInformation *otherInfo;
1019 } Z_DeleteResultSetRequest;
1021 typedef struct Z_DeleteResultSetResponse
1023 Z_ReferenceId *referenceId; /* OPTIONAL */
1024 int *deleteOperationStatus;
1026 Z_ListStatus *deleteListStatuses; /* OPTIONAL */
1027 int *numberNotDeleted; /* OPTIONAL */
1028 int num_bulkStatuses;
1029 Z_ListStatus *bulkStatuses; /* OPTIONAL */
1030 char *deleteMessage; /* OPTIONAL */
1032 Z_OtherInformation *otherInfo;
1034 } Z_DeleteResultSetResponse;
1036 /* ------------------------ CLOSE SERVICE ------------------- */
1038 typedef struct Z_Close
1040 Z_ReferenceId *referenceId; /* OPTIONAL */
1042 #define Z_Close_finished 0
1043 #define Z_Close_shutdown 1
1044 #define Z_Close_systemProblem 2
1045 #define Z_Close_costLimit 3
1046 #define Z_Close_resources 4
1047 #define Z_Close_securityViolation 5
1048 #define Z_Close_protocolError 6
1049 #define Z_Close_lackOfActivity 7
1050 #define Z_Close_peerAbort 8
1051 #define Z_Close_unspecified 9
1052 char *diagnosticInformation; /* OPTIONAL */
1053 Odr_oid *resourceReportFormat; /* OPTIONAL */
1054 Z_External *resourceReport; /* OPTIONAL */
1056 Z_OtherInformation *otherInfo; /* OPTIONAL */
1060 /* ------------------------ SEGMENTATION -------------------- */
1062 typedef struct Z_Segment
1064 Z_ReferenceId *referenceId; /* OPTIONAL */
1065 int *numberOfRecordsReturned;
1066 int num_segmentRecords;
1067 Z_NamePlusRecord **segmentRecords;
1068 Z_OtherInformation *otherInfo; /* OPTIONAL */
1071 /* ----------------------- Extended Services ---------------- */
1073 typedef struct Z_Permissions
1076 int num_allowableFunctions;
1077 int **allowableFunctions;
1078 #define Z_Permissions_delete 1
1079 #define Z_Permissions_modifyContents 2
1080 #define Z_Permissions_modifyPermissions 3
1081 #define Z_Permissions_present 4
1082 #define Z_Permissions_invoke 5
1085 typedef struct Z_ExtendedServicesRequest
1087 Z_ReferenceId *referenceId; /* OPTIONAL */
1089 #define Z_ExtendedServicesRequest_create 1
1090 #define Z_ExtendedServicesRequest_delete 2
1091 #define Z_ExtendedServicesRequest_modify 3
1092 Odr_oid *packageType;
1093 char *packageName; /* OPTIONAL */
1094 char *userId; /* OPTIONAL */
1095 Z_IntUnit *retentionTime; /* OPTIONAL */
1096 Z_Permissions *permissions; /* OPTIONAL */
1097 char *description; /* OPTIONAL */
1098 Z_External *taskSpecificParameters; /* OPTIONAL */
1100 #define Z_ExtendedServicesRequest_wait 1
1101 #define Z_ExtendedServicesRequest_waitIfPossible 2
1102 #define Z_ExtendedServicesRequest_dontWait 3
1103 #define Z_ExtendedServicesRequest_dontReturnPackage 4
1104 char *elements; /* OPTIONAL */
1105 Z_OtherInformation *otherInfo; /* OPTIONAL */
1106 } Z_ExtendedServicesRequest;
1108 typedef struct Z_ExtendedServicesResponse
1110 Z_ReferenceId *referenceId; /* OPTIONAL */
1111 int *operationStatus;
1112 #define Z_ExtendedServicesResponse_done 1
1113 #define Z_ExtendedServicesResponse_accepted 2
1114 #define Z_ExtendedServicesResponse_failure 3
1115 int num_diagnostics;
1116 Z_DiagRec **diagnostics; /* OPTIONAL */
1117 Z_External *taskPackage; /* OPTIONAL */
1118 Z_OtherInformation *otherInfo; /* OPTIONAL */
1119 } Z_ExtendedServicesResponse;
1121 /* ------------------------ Sort --------------------------- */
1123 typedef struct Z_SortAttributes
1126 Z_AttributeList *list;
1129 typedef struct Z_SortKey
1132 #define Z_SortKey_sortField 0
1133 #define Z_SortKey_elementSpec 1
1134 #define Z_SortKey_sortAttributes 2
1138 Z_Specification *elementSpec;
1139 Z_SortAttributes *sortAttributes;
1143 typedef struct Z_SortDbSpecific
1149 typedef struct Z_SortDbSpecificList
1152 Z_SortDbSpecific **dbSpecific;
1153 } Z_SortDbSpecificList;
1155 typedef struct Z_SortElement
1158 #define Z_SortElement_generic 0
1159 #define Z_SortElement_databaseSpecific 1
1163 Z_SortDbSpecificList *databaseSpecific;
1167 typedef struct Z_SortMissingValueAction
1170 #define Z_SortMissingValAct_abort 0
1171 #define Z_SortMissingValAct_null 1
1172 #define Z_SortMissingValAct_valData 2
1179 } Z_SortMissingValueAction;
1181 typedef struct Z_SortKeySpec
1183 Z_SortElement *sortElement;
1185 #define Z_SortRelation_ascending 0
1186 #define Z_SortRelation_descending 1
1187 #define Z_SortRelation_ascendingByFreq 3
1188 #define Z_SortRelation_descendingByFreq 4
1189 int *caseSensitivity;
1190 #define Z_SortCase_caseSensitive 0
1191 #define Z_SortCase_caseInsensitive 1
1192 Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
1195 typedef struct Z_SortResponse
1197 Z_ReferenceId *referenceId; /* OPTIONAL */
1199 #define Z_SortStatus_success 0
1200 #define Z_SortStatus_partial_1 1
1201 #define Z_SortStatus_failure 2
1202 int *resultSetStatus; /* OPTIONAL */
1203 #define Z_SortResultSetStatus_empty 1
1204 #define Z_SortResultSetStatus_interim 2
1205 #define Z_SortResultSetStatus_unchanged 3
1206 #define Z_SortResultSetStatus_none 4
1207 Z_DiagRecs *diagnostics; /* OPTIONAL */
1208 Z_OtherInformation *otherInfo; /* OPTIONAL */
1211 typedef struct Z_SortKeySpecList
1214 Z_SortKeySpec **specs;
1215 } Z_SortKeySpecList;
1217 typedef struct Z_SortRequest
1219 Z_ReferenceId *referenceId; /* OPTIONAL */
1220 Z_StringList *inputResultSetNames;
1221 char *sortedResultSetName;
1222 Z_SortKeySpecList *sortSequence;
1223 Z_OtherInformation *otherInfo; /* OPTIONAL */
1226 /* ------------------------ APDU ---------------------------- */
1228 typedef struct Z_APDU
1231 #define Z_APDU_initRequest 0
1232 #define Z_APDU_initResponse 1
1233 #define Z_APDU_searchRequest 2
1234 #define Z_APDU_searchResponse 3
1235 #define Z_APDU_presentRequest 4
1236 #define Z_APDU_presentResponse 5
1237 #define Z_APDU_deleteResultSetRequest 6
1238 #define Z_APDU_deleteResultSetResponse 7
1239 #define Z_APDU_resourceControlRequest 8
1240 #define Z_APDU_resourceControlResponse 9
1241 #define Z_APDU_triggerResourceControlRequest 10
1242 #define Z_APDU_scanRequest 11
1243 #define Z_APDU_scanResponse 12
1244 #define Z_APDU_segmentRequest 13
1245 #define Z_APDU_extendedServicesRequest 14
1246 #define Z_APDU_extendedServicesResponse 15
1247 #define Z_APDU_close 16
1248 #define Z_APDU_accessControlRequest 17
1249 #define Z_APDU_accessControlResponse 18
1250 #define Z_APDU_sortRequest 20
1251 #define Z_APDU_sortResponse 21
1254 Z_InitRequest *initRequest;
1255 Z_InitResponse *initResponse;
1256 Z_SearchRequest *searchRequest;
1257 Z_SearchResponse *searchResponse;
1258 Z_PresentRequest *presentRequest;
1259 Z_PresentResponse *presentResponse;
1260 Z_DeleteResultSetRequest *deleteResultSetRequest;
1261 Z_DeleteResultSetResponse *deleteResultSetResponse;
1262 Z_AccessControlRequest *accessControlRequest;
1263 Z_AccessControlResponse *accessControlResponse;
1264 Z_ResourceControlRequest *resourceControlRequest;
1265 Z_ResourceControlResponse *resourceControlResponse;
1266 Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1267 Z_ScanRequest *scanRequest;
1268 Z_ScanResponse *scanResponse;
1269 Z_SortRequest *sortRequest;
1270 Z_SortResponse *sortResponse;
1271 Z_Segment *segmentRequest;
1272 Z_ExtendedServicesRequest *extendedServicesRequest;
1273 Z_ExtendedServicesResponse *extendedServicesResponse;
1278 int z_APDU(ODR o, Z_APDU **p, int opt);
1279 int z_SUTRS(ODR o, Odr_oct **p, int opt);
1281 Z_InitRequest *zget_InitRequest(ODR o);
1282 Z_InitResponse *zget_InitResponse(ODR o);
1283 Z_SearchRequest *zget_SearchRequest(ODR o);
1284 Z_SearchResponse *zget_SearchResponse(ODR o);
1285 Z_PresentRequest *zget_PresentRequest(ODR o);
1286 Z_PresentResponse *zget_PresentResponse(ODR o);
1287 Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1288 Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1289 Z_ScanRequest *zget_ScanRequest(ODR o);
1290 Z_ScanResponse *zget_ScanResponse(ODR o);
1291 Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1292 Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1293 Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1294 Z_Close *zget_Close(ODR o);
1295 int z_StringList(ODR o, Z_StringList **p, int opt);
1296 int z_InternationalString(ODR o, char **p, int opt);
1297 int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt);
1298 int z_ElementSetName(ODR o, char **p, int opt);
1299 int z_IntUnit(ODR o, Z_IntUnit **p, int opt);
1300 int z_Unit(ODR o, Z_Unit **p, int opt);
1301 int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt);
1302 int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt);
1303 int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt);
1304 int z_Term(ODR o, Z_Term **p, int opt);
1305 int z_Specification(ODR o, Z_Specification **p, int opt);
1306 int z_Permissions(ODR o, Z_Permissions **p, int opt);
1307 int z_DiagRec(ODR o, Z_DiagRec **p, int opt);
1308 int z_AttributeList(ODR o, Z_AttributeList **p, int opt);
1309 int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt);
1310 Z_APDU *zget_APDU(ODR o, int which);
1312 #include <prt-rsc.h>
1313 #include <prt-acc.h>
1314 #include <prt-exp.h>
1315 #include <prt-grs.h>
1316 #include <prt-exd.h>
1317 #include <prt-dia.h>
1318 #include <prt-esp.h>
1320 #include <prt-ext.h>