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.34 1996-06-10 08:55:36 quinn
28 * Added Summary. Unfinished work
30 * Revision 1.33 1996/02/23 10:00:51 quinn
33 * Revision 1.32 1996/02/20 12:52:39 quinn
36 * Revision 1.31 1996/01/22 09:46:45 quinn
37 * Added Sort PDU. Moved StringList to main protocol file.
39 * Revision 1.30 1996/01/10 15:21:32 quinn
40 * Added links to access control PDUs
42 * Revision 1.29 1996/01/02 11:46:49 quinn
43 * Changed 'operator' to 'roperator' to avoid C++ conflict.
46 * Revision 1.28 1996/01/02 08:57:32 quinn
47 * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
49 * Revision 1.27 1995/10/12 10:34:46 quinn
52 * Revision 1.26 1995/09/29 17:12:08 quinn
55 * Revision 1.25 1995/09/27 15:02:49 quinn
56 * Modified function heads & prototypes.
58 * Revision 1.24 1995/08/29 11:17:43 quinn
59 * *** empty log message ***
61 * Revision 1.23 1995/08/21 09:10:36 quinn
62 * Smallish fixes to suppport new formats.
64 * Revision 1.22 1995/08/17 12:45:14 quinn
65 * Fixed minor problems with GRS-1. Added support in c&s.
67 * Revision 1.21 1995/08/15 12:00:11 quinn
70 * Revision 1.20 1995/08/10 08:54:35 quinn
73 * Revision 1.19 1995/06/19 12:38:28 quinn
74 * Reorganized include-files. Added small features.
76 * Revision 1.18 1995/06/16 13:16:05 quinn
77 * Fixed Defaultdiagformat.
79 * Revision 1.17 1995/06/15 15:42:05 quinn
82 * Revision 1.16 1995/06/15 07:45:06 quinn
85 * Revision 1.15 1995/06/14 15:26:43 quinn
86 * *** empty log message ***
88 * Revision 1.14 1995/06/07 14:42:34 quinn
91 * Revision 1.13 1995/06/07 14:36:47 quinn
94 * Revision 1.12 1995/06/05 10:53:13 quinn
97 * Revision 1.11 1995/06/02 09:49:47 quinn
100 * Revision 1.10 1995/05/29 08:11:34 quinn
101 * Moved oid from odr/asn to util.
103 * Revision 1.9 1995/05/22 11:31:25 quinn
106 * Revision 1.8 1995/05/17 08:41:35 quinn
107 * Added delete to proto & other little things.
108 * Relaying auth info to backend.
110 * Revision 1.7 1995/05/16 08:50:37 quinn
111 * License, documentation, and memory fixes
113 * Revision 1.6 1995/05/15 11:55:55 quinn
114 * Work on asynchronous activity.
116 * Revision 1.5 1995/04/17 11:28:18 quinn
119 * Revision 1.4 1995/04/10 10:22:47 quinn
122 * Revision 1.3 1995/03/30 12:18:09 quinn
125 * Revision 1.2 1995/03/30 10:26:48 quinn
126 * Added Term structure
128 * Revision 1.1 1995/03/30 09:39:42 quinn
129 * Moved .h files to include directory
131 * Revision 1.11 1995/03/30 09:08:44 quinn
132 * Added Resource control protocol
134 * Revision 1.10 1995/03/29 15:39:39 quinn
135 * Adding some resource control elements, and a null-check to getentbyoid
137 * Revision 1.9 1995/03/29 08:06:18 quinn
138 * Added a few v3 elements
140 * Revision 1.8 1995/03/22 10:12:49 quinn
141 * Added Z_PRES constants.
143 * Revision 1.7 1995/03/20 09:45:12 quinn
146 * Revision 1.5 1995/03/07 16:29:34 quinn
147 * Added authentication stuff.
149 * Revision 1.4 1995/03/07 10:13:00 quinn
150 * Added prototype for z_APDU()
152 * Revision 1.3 1995/02/14 11:54:23 quinn
155 * Revision 1.2 1995/02/09 15:51:40 quinn
158 * Revision 1.1 1995/02/06 16:44:48 quinn
159 * First hack at Z/SR protocol
170 #include <yaz-version.h>
173 * Because we didn't have time to put all of the extra v3 elements in here
174 * before the first applications were written, we have to place them
175 * in #ifdefs in places where they would break existing code. If you are
176 * developing new stuff, we urge you to leave them in, even if you don't
177 * intend to use any v3 features. When we are comfortable that the old
178 * apps have been updated, we'll remove the #ifdefs.
183 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
186 typedef struct Z_External Z_External;
188 typedef Odr_oct Z_ReferenceId;
189 typedef char Z_DatabaseName;
190 typedef char Z_ResultSetId;
191 typedef Odr_oct Z_ResultsetId;
193 typedef struct Z_InfoCategory
195 Odr_oid *categoryTypeId; /* OPTIONAL */
199 typedef struct Z_OtherInformationUnit
201 Z_InfoCategory *category; /* OPTIONAL */
203 #define Z_OtherInfo_characterInfo 0
204 #define Z_OtherInfo_binaryInfo 1
205 #define Z_OtherInfo_externallyDefinedInfo 2
206 #define Z_OtherInfo_oid 3
211 Z_External *externallyDefinedInfo;
214 } Z_OtherInformationUnit;
216 typedef struct Z_OtherInformation
219 Z_OtherInformationUnit **list;
220 } Z_OtherInformation;
222 typedef struct Z_StringOrNumeric
225 #define Z_StringOrNumeric_string 0
226 #define Z_StringOrNumeric_numeric 1
234 typedef struct Z_Unit
236 char *unitSystem; /* OPTIONAL */
237 Z_StringOrNumeric *unitType; /* OPTIONAL */
238 Z_StringOrNumeric *unit; /* OPTIONAL */
239 int *scaleFactor; /* OPTIONAL */
242 typedef struct Z_IntUnit
248 typedef Odr_oct Z_SUTRS;
250 typedef struct Z_StringList
256 /* ----------------- INIT SERVICE ----------------*/
260 char *groupId; /* OPTIONAL */
261 char *userId; /* OPTIONAL */
262 char *password; /* OPTIONAL */
265 typedef struct Z_IdAuthentication
268 #define Z_IdAuthentication_open 0
269 #define Z_IdAuthentication_idPass 1
270 #define Z_IdAuthentication_anonymous 2
271 #define Z_IdAuthentication_other 3
279 } Z_IdAuthentication;
281 #define Z_ProtocolVersion_1 0
282 #define Z_ProtocolVersion_2 1
283 #define Z_ProtocolVersion_3 2
285 #define Z_Options_search 0
286 #define Z_Options_present 1
287 #define Z_Options_delSet 2
288 #define Z_Options_resourceReport 3
289 #define Z_Options_triggerResourceCtrl 4
290 #define Z_Options_resourceCtrl 5
291 #define Z_Options_accessCtrl 6
292 #define Z_Options_scan 7
293 #define Z_Options_sort 8
294 #define Z_Options_reserved 9
295 #define Z_Options_extendedServices 10
296 #define Z_Options_level_1Segmentation 11
297 #define Z_Options_level_2Segmentation 12
298 #define Z_Options_concurrentOperations 13
299 #define Z_Options_namedResultSets 14
301 typedef struct Z_InitRequest
303 Z_ReferenceId *referenceId; /* OPTIONAL */
304 Odr_bitmask *protocolVersion;
305 Odr_bitmask *options;
306 int *preferredMessageSize;
307 int *maximumRecordSize;
308 Z_IdAuthentication* idAuthentication; /* OPTIONAL */
309 char *implementationId; /* OPTIONAL */
310 char *implementationName; /* OPTIONAL */
311 char *implementationVersion; /* OPTIONAL */
312 Z_External *userInformationField; /* OPTIONAL */
314 Z_OtherInformation *otherInfo; /* OPTIONAL */
318 typedef struct Z_InitResponse
320 Z_ReferenceId *referenceId; /* OPTIONAL */
321 Odr_bitmask *protocolVersion;
322 Odr_bitmask *options;
323 int *preferredMessageSize;
324 int *maximumRecordSize;
326 char *implementationId; /* OPTIONAL */
327 char *implementationName; /* OPTIONAL */
328 char *implementationVersion; /* OPTIONAL */
329 Z_External *userInformationField; /* OPTIONAL */
331 Z_OtherInformation *otherInfo; /* OPTIONAL */
335 typedef struct Z_NSRAuthentication
340 } Z_NSRAuthentication;
342 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
344 int z_StrAuthentication(ODR o, char **p, int opt);
346 /* ------------------ SEARCH SERVICE ----------------*/
348 typedef struct Z_DatabaseSpecificUnit
351 char *elementSetName;
352 } Z_DatabaseSpecificUnit;
354 typedef struct Z_DatabaseSpecific
357 Z_DatabaseSpecificUnit **elements;
358 } Z_DatabaseSpecific;
360 typedef struct Z_ElementSetNames
363 #define Z_ElementSetNames_generic 0
364 #define Z_ElementSetNames_databaseSpecific 1
368 Z_DatabaseSpecific *databaseSpecific;
372 /* ---------------------- RPN QUERY --------------------------- */
374 typedef struct Z_ComplexAttribute
377 Z_StringOrNumeric **list;
378 int num_semanticAction;
379 int **semanticAction; /* OPTIONAL */
380 } Z_ComplexAttribute;
382 typedef struct Z_AttributeElement
385 Odr_oid *attributeSet; /* OPTIONAL - v3 only */
390 #define Z_AttributeValue_numeric 0
391 #define Z_AttributeValue_complex 1
395 Z_ComplexAttribute *complex;
400 } Z_AttributeElement;
402 typedef struct Z_Term
405 #define Z_Term_general 0
406 #define Z_Term_numeric 1
407 #define Z_Term_characterString 2
409 #define Z_Term_dateTime 4
410 #define Z_Term_external 5
411 #define Z_Term_integerAndUnit 6
412 #define Z_Term_null 7
415 Odr_oct *general; /* this is required for v2 */
417 char *characterString;
420 Z_External *external;
421 /* Z_IntUnit *integerAndUnit; */
426 typedef struct Z_AttributesPlusTerm
429 Z_AttributeElement **attributeList;
431 } Z_AttributesPlusTerm;
433 typedef struct Z_ResultSetPlusAttributes
437 Z_AttributeElement **attributeList;
438 } Z_ResultSetPlusAttributes;
440 typedef struct Z_ProximityOperator
442 bool_t *exclusion; /* OPTIONAL */
446 #define Z_Prox_lessThan 1
447 #define Z_Prox_lessThanOrEqual 2
448 #define Z_Prox_equal 3
449 #define Z_Prox_greaterThanOrEqual 4
450 #define Z_Prox_greaterThan 5
451 #define Z_Prox_notEqual 6
453 #define Z_ProxCode_known 0
454 #define Z_ProxCode_private 1
455 int *proximityUnitCode;
456 #define Z_ProxUnit_character 1
457 #define Z_ProxUnit_word 2
458 #define Z_ProxUnit_sentence 3
459 #define Z_ProxUnit_paragraph 4
460 #define Z_ProxUnit_section 5
461 #define Z_ProxUnit_chapter 6
462 #define Z_ProxUnit_document 7
463 #define Z_ProxUnit_element 8
464 #define Z_ProxUnit_subelement 9
465 #define Z_ProxUnit_elementType 10
466 #define Z_ProxUnit_byte 11 /* v3 only */
467 } Z_ProximityOperator;
469 typedef struct Z_Operator
472 #define Z_Operator_and 0
473 #define Z_Operator_or 1
474 #define Z_Operator_and_not 2
475 #define Z_Operator_prox 3
478 Odr_null *and; /* these guys are nulls. */
481 Z_ProximityOperator *prox;
485 typedef struct Z_Operand
488 #define Z_Operand_APT 0
489 #define Z_Operand_resultSetId 1
490 #define Z_Operand_resultAttr /* v3 only */ 2
493 Z_AttributesPlusTerm *attributesPlusTerm;
494 Z_ResultSetId *resultSetId;
495 Z_ResultSetPlusAttributes *resultAttr;
499 typedef struct Z_Complex
501 struct Z_RPNStructure *s1;
502 struct Z_RPNStructure *s2;
503 Z_Operator *roperator;
506 typedef struct Z_RPNStructure
509 #define Z_RPNStructure_simple 0
510 #define Z_RPNStructure_complex 1
518 typedef struct Z_RPNQuery
520 Odr_oid *attributeSetId;
521 Z_RPNStructure *RPNStructure;
524 /* -------------------------- SEARCHREQUEST -------------------------- */
526 typedef struct Z_Query
529 #define Z_Query_type_1 1
530 #define Z_Query_type_2 2
531 #define Z_Query_type_101 3
536 Z_RPNQuery *type_101;
540 typedef struct Z_SearchRequest
542 Z_ReferenceId *referenceId; /* OPTIONAL */
543 int *smallSetUpperBound;
544 int *largeSetLowerBound;
545 int *mediumSetPresentNumber;
546 bool_t *replaceIndicator;
548 int num_databaseNames;
549 char **databaseNames;
550 Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */
551 Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */
552 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
555 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */
556 Z_OtherInformation *otherInfo; /* OPTIONAL */
560 /* ------------------------ RECORD -------------------------- */
562 typedef Z_External Z_DatabaseRecord;
566 typedef struct Z_DefaultDiagFormat
568 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
570 /* until the whole character set issue becomes more definite,
571 * you can probably ignore this on input. */
573 #define Z_DiagForm_v2AddInfo 0
574 #define Z_DiagForm_v3AddInfo 1
576 } Z_DefaultDiagFormat;
578 typedef struct Z_DiagRec
581 #define Z_DiagRec_defaultFormat 0
582 #define Z_DiagRec_externallyDefined 1
585 Z_DefaultDiagFormat *defaultFormat;
586 Z_External *externallyDefined;
592 typedef struct Z_DiagRec
594 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
601 typedef struct Z_DiagRecs
604 Z_DiagRec **diagRecs;
607 typedef struct Z_NamePlusRecord
609 char *databaseName; /* OPTIONAL */
611 #define Z_NamePlusRecord_databaseRecord 0
612 #define Z_NamePlusRecord_surrogateDiagnostic 1
615 Z_DatabaseRecord *databaseRecord;
616 Z_DiagRec *surrogateDiagnostic;
620 typedef struct Z_NamePlusRecordList
623 Z_NamePlusRecord **records;
624 } Z_NamePlusRecordList;
626 typedef struct Z_Records
629 #define Z_Records_DBOSD 0
630 #define Z_Records_NSD 1
631 #define Z_Records_multipleNSD 2
634 Z_NamePlusRecordList *databaseOrSurDiagnostics;
635 Z_DiagRec *nonSurrogateDiagnostic;
636 Z_DiagRecs *multipleNonSurDiagnostics;
640 /* ------------------------ SEARCHRESPONSE ------------------ */
642 typedef struct Z_SearchResponse
644 Z_ReferenceId *referenceId; /* OPTIONAL */
646 int *numberOfRecordsReturned;
647 int *nextResultSetPosition;
648 bool_t *searchStatus;
649 int *resultSetStatus; /* OPTIONAL */
650 #define Z_RES_SUBSET 1
651 #define Z_RES_INTERIM 2
653 int *presentStatus; /* OPTIONAL */
654 #define Z_PRES_SUCCESS 0
655 #define Z_PRES_PARTIAL_1 1
656 #define Z_PRES_PARTIAL_2 2
657 #define Z_PRES_PARTIAL_3 3
658 #define Z_PRES_PARTIAL_4 4
659 #define Z_PRES_FAILURE 5
660 Z_Records *records; /* OPTIONAL */
662 Z_OtherInformation *additionalSearchInfo;
663 Z_OtherInformation *otherInfo;
667 /* ------------------------- PRESENT SERVICE -----------------*/
669 typedef struct Z_ElementSpec
672 #define Z_ElementSpec_elementSetName 0
673 #define Z_ElementSpec_externalSpec 1
676 char *elementSetName;
677 Z_External *externalSpec;
681 typedef struct Z_Specification
683 Odr_oid *schema; /* OPTIONAL */
684 Z_ElementSpec *elementSpec; /* OPTIONAL */
687 typedef struct Z_DbSpecific
690 Z_Specification *spec;
693 typedef struct Z_CompSpec
695 bool_t *selectAlternativeSyntax;
696 Z_Specification *generic; /* OPTIONAL */
698 Z_DbSpecific **dbSpecific; /* OPTIONAL */
699 int num_recordSyntax;
700 Odr_oid **recordSyntax; /* OPTIONAL */
703 typedef struct Z_RecordComposition
706 #define Z_RecordComp_simple 0
707 #define Z_RecordComp_complex 1
710 Z_ElementSetNames *simple;
713 } Z_RecordComposition;
715 typedef struct Z_Range
717 int *startingPosition;
718 int *numberOfRecords;
721 typedef struct Z_PresentRequest
723 Z_ReferenceId *referenceId; /* OPTIONAL */
724 Z_ResultSetId *resultSetId;
725 int *resultSetStartPoint;
726 int *numberOfRecordsRequested;
729 Z_Range **additionalRanges; /* OPTIONAL */
730 Z_RecordComposition *recordComposition; /* OPTIONAL */
732 Z_ElementSetNames *elementSetNames; /* OPTIONAL */
734 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
736 int *maxSegmentCount; /* OPTIONAL */
737 int *maxRecordSize; /* OPTIONAL */
738 int *maxSegmentSize; /* OPTIONAL */
739 Z_OtherInformation *otherInfo; /* OPTIONAL */
743 typedef struct Z_PresentResponse
745 Z_ReferenceId *referenceId; /* OPTIONAL */
746 int *numberOfRecordsReturned;
747 int *nextResultSetPosition;
751 Z_OtherInformation *otherInfo; /* OPTIONAL */
755 /* ------------------ RESOURCE CONTROL ----------------*/
757 typedef struct Z_TriggerResourceControlRequest
759 Z_ReferenceId *referenceId; /* OPTIONAL */
760 int *requestedAction;
761 #define Z_TriggerResourceCtrl_resourceReport 1
762 #define Z_TriggerResourceCtrl_resourceControl 2
763 #define Z_TriggerResourceCtrl_cancel 3
764 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
765 bool_t *resultSetWanted; /* OPTIONAL */
767 Z_OtherInformation *otherInfo;
769 } Z_TriggerResourceControlRequest;
771 typedef struct Z_ResourceControlRequest
773 Z_ReferenceId *referenceId; /* OPTIONAL */
774 bool_t *suspendedFlag; /* OPTIONAL */
775 Z_External *resourceReport; /* OPTIONAL */
776 int *partialResultsAvailable; /* OPTIONAL */
777 #define Z_ResourceControlRequest_subset 1
778 #define Z_ResourceControlRequest_interim 2
779 #define Z_ResourceControlRequest_none 3
780 bool_t *responseRequired;
781 bool_t *triggeredRequestFlag; /* OPTIONAL */
783 Z_OtherInformation *otherInfo;
785 } Z_ResourceControlRequest;
787 typedef struct Z_ResourceControlResponse
789 Z_ReferenceId *referenceId; /* OPTIONAL */
790 bool_t *continueFlag;
791 bool_t *resultSetWanted; /* OPTIONAL */
793 Z_OtherInformation *otherInfo;
795 } Z_ResourceControlResponse;
798 /* ------------------ ACCESS CTRL SERVICE ----------------*/
800 typedef struct Z_AccessControlRequest
802 Z_ReferenceId *referenceId; /* OPTIONAL */
804 #define Z_AccessRequest_simpleForm 0
805 #define Z_AccessRequest_externallyDefined 1
809 Z_External *externallyDefined;
812 Z_OtherInformation *otherInfo; /* OPTIONAL */
814 } Z_AccessControlRequest;
816 typedef struct Z_AccessControlResponse
818 Z_ReferenceId *referenceId; /* OPTIONAL */
820 #define Z_AccessResponse_simpleForm 0
821 #define Z_AccessResponse_externallyDefined 1
825 Z_External *externallyDefined;
827 Z_DiagRec *diagnostic; /* OPTIONAL */
829 Z_OtherInformation *otherInfo; /* OPTIONAL */
831 } Z_AccessControlResponse;
833 /* ------------------------ SCAN SERVICE -------------------- */
835 typedef struct Z_AttributeList
838 Z_AttributeElement **attributes;
841 typedef struct Z_AlternativeTerm
844 Z_AttributesPlusTerm **terms;
849 typedef struct Z_ByDatabase
852 int *num; /* OPTIONAL */
853 Z_OtherInformation *otherDbInfo; /* OPTIONAL */
856 typedef struct Z_ByDatabaseList
859 Z_ByDatabase **elements;
862 typedef struct Z_ScanOccurrences
865 #define Z_ScanOccurrences_global 0
866 #define Z_ScanOccurrences_byDatabase 1
870 Z_ByDatabaseList *byDatabase;
875 typedef struct Z_OccurrenceByAttributesElem
877 Z_AttributeList *attributes;
878 Z_ScanOccurrences *occurrences; /* OPTIONAL */
879 Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
880 } Z_OccurrenceByAttributesElem;
882 typedef struct Z_OccurrenceByAttributes
885 Z_OccurrenceByAttributesElem **elements;
886 } Z_OccurrenceByAttributes;
891 * Old, incomplete definition of OccurrenceByAttributes.
894 typedef struct Z_OccurrenceByAttributes
896 Z_AttributeList *attributes;
899 #define Z_OByAtt_global 0
900 #define Z_ObyAtt_byDatabase 1
906 /* Z_ByDatabase *byDatabase; */
909 } Z_OccurrenceByAttributes;
913 typedef struct Z_TermInfo
916 char *displayTerm; /* OPTIONAL */
917 Z_AttributeList *suggestedAttributes; /* OPTIONAL */
918 Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
919 int *globalOccurrences; /* OPTIONAL */
920 Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
921 Z_OtherInformation *otherTermInfo; /* OPTIONAL */
924 typedef struct Z_Entry
927 #define Z_Entry_termInfo 0
928 #define Z_Entry_surrogateDiagnostic 1
931 Z_TermInfo *termInfo;
932 Z_DiagRec *surrogateDiagnostic;
936 typedef struct Z_Entries
942 typedef struct Z_ListEntries
945 #define Z_ListEntries_entries 0
946 #define Z_ListEntries_nonSurrogateDiagnostics 1
950 Z_DiagRecs *nonSurrogateDiagnostics;
954 typedef struct Z_ScanRequest
956 Z_ReferenceId *referenceId; /* OPTIONAL */
957 int num_databaseNames;
958 char **databaseNames;
959 Odr_oid *attributeSet; /* OPTIONAL */
960 Z_AttributesPlusTerm *termListAndStartPoint;
961 int *stepSize; /* OPTIONAL */
962 int *numberOfTermsRequested;
963 int *preferredPositionInResponse; /* OPTIONAL */
965 Z_OtherInformation *otherInfo;
969 typedef struct Z_ScanResponse
971 Z_ReferenceId *referenceId; /* OPTIONAL */
972 int *stepSize; /* OPTIONAL */
974 #define Z_Scan_success 0
975 #define Z_Scan_partial_1 1
976 #define Z_Scan_partial_2 2
977 #define Z_Scan_partial_3 3
978 #define Z_Scan_partial_4 4
979 #define Z_Scan_partial_5 5
980 #define Z_Scan_failure 6
981 int *numberOfEntriesReturned;
982 int *positionOfTerm; /* OPTIONAL */
983 Z_ListEntries *entries; /* OPTIONAL */
984 Odr_oid *attributeSet; /* OPTIONAL */
986 Z_OtherInformation *otherInfo;
991 /* ------------------------ DELETE -------------------------- */
993 #define Z_DeleteStatus_success 0
994 #define Z_DeleteStatus_resultSetDidNotExist 1
995 #define Z_DeleteStatus_previouslyDeletedByTarget 2
996 #define Z_DeleteStatus_systemProblemAtTarget 3
997 #define Z_DeleteStatus_accessNotAllowed 4
998 #define Z_DeleteStatus_resourceControlAtOrigin 5
999 #define Z_DeleteStatus_resourceControlAtTarget 6
1000 #define Z_DeleteStatus_bulkDeleteNotSupported 7
1001 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
1002 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
1003 #define Z_DeleteStatus_resultSetInUse 10
1005 typedef struct Z_ListStatus
1011 typedef struct Z_DeleteResultSetRequest
1013 Z_ReferenceId *referenceId; /* OPTIONAL */
1014 int *deleteFunction;
1015 #define Z_DeleteRequest_list 0
1016 #define Z_DeleteRequest_all 1
1018 Z_ResultSetId **resultSetList; /* OPTIONAL */
1020 Z_OtherInformation *otherInfo;
1022 } Z_DeleteResultSetRequest;
1024 typedef struct Z_DeleteResultSetResponse
1026 Z_ReferenceId *referenceId; /* OPTIONAL */
1027 int *deleteOperationStatus;
1029 Z_ListStatus *deleteListStatuses; /* OPTIONAL */
1030 int *numberNotDeleted; /* OPTIONAL */
1031 int num_bulkStatuses;
1032 Z_ListStatus *bulkStatuses; /* OPTIONAL */
1033 char *deleteMessage; /* OPTIONAL */
1035 Z_OtherInformation *otherInfo;
1037 } Z_DeleteResultSetResponse;
1039 /* ------------------------ CLOSE SERVICE ------------------- */
1041 typedef struct Z_Close
1043 Z_ReferenceId *referenceId; /* OPTIONAL */
1045 #define Z_Close_finished 0
1046 #define Z_Close_shutdown 1
1047 #define Z_Close_systemProblem 2
1048 #define Z_Close_costLimit 3
1049 #define Z_Close_resources 4
1050 #define Z_Close_securityViolation 5
1051 #define Z_Close_protocolError 6
1052 #define Z_Close_lackOfActivity 7
1053 #define Z_Close_peerAbort 8
1054 #define Z_Close_unspecified 9
1055 char *diagnosticInformation; /* OPTIONAL */
1056 Odr_oid *resourceReportFormat; /* OPTIONAL */
1057 Z_External *resourceReport; /* OPTIONAL */
1059 Z_OtherInformation *otherInfo; /* OPTIONAL */
1063 /* ------------------------ SEGMENTATION -------------------- */
1065 typedef struct Z_Segment
1067 Z_ReferenceId *referenceId; /* OPTIONAL */
1068 int *numberOfRecordsReturned;
1069 int num_segmentRecords;
1070 Z_NamePlusRecord **segmentRecords;
1071 Z_OtherInformation *otherInfo; /* OPTIONAL */
1074 /* ----------------------- Extended Services ---------------- */
1076 typedef struct Z_Permissions
1079 int num_allowableFunctions;
1080 int **allowableFunctions;
1081 #define Z_Permissions_delete 1
1082 #define Z_Permissions_modifyContents 2
1083 #define Z_Permissions_modifyPermissions 3
1084 #define Z_Permissions_present 4
1085 #define Z_Permissions_invoke 5
1088 typedef struct Z_ExtendedServicesRequest
1090 Z_ReferenceId *referenceId; /* OPTIONAL */
1092 #define Z_ExtendedServicesRequest_create 1
1093 #define Z_ExtendedServicesRequest_delete 2
1094 #define Z_ExtendedServicesRequest_modify 3
1095 Odr_oid *packageType;
1096 char *packageName; /* OPTIONAL */
1097 char *userId; /* OPTIONAL */
1098 Z_IntUnit *retentionTime; /* OPTIONAL */
1099 Z_Permissions *permissions; /* OPTIONAL */
1100 char *description; /* OPTIONAL */
1101 Z_External *taskSpecificParameters; /* OPTIONAL */
1103 #define Z_ExtendedServicesRequest_wait 1
1104 #define Z_ExtendedServicesRequest_waitIfPossible 2
1105 #define Z_ExtendedServicesRequest_dontWait 3
1106 #define Z_ExtendedServicesRequest_dontReturnPackage 4
1107 char *elements; /* OPTIONAL */
1108 Z_OtherInformation *otherInfo; /* OPTIONAL */
1109 } Z_ExtendedServicesRequest;
1111 typedef struct Z_ExtendedServicesResponse
1113 Z_ReferenceId *referenceId; /* OPTIONAL */
1114 int *operationStatus;
1115 #define Z_ExtendedServicesResponse_done 1
1116 #define Z_ExtendedServicesResponse_accepted 2
1117 #define Z_ExtendedServicesResponse_failure 3
1118 int num_diagnostics;
1119 Z_DiagRec **diagnostics; /* OPTIONAL */
1120 Z_External *taskPackage; /* OPTIONAL */
1121 Z_OtherInformation *otherInfo; /* OPTIONAL */
1122 } Z_ExtendedServicesResponse;
1124 /* ------------------------ Sort --------------------------- */
1126 typedef struct Z_SortAttributes
1129 Z_AttributeList *list;
1132 typedef struct Z_SortKey
1135 #define Z_SortKey_sortField 0
1136 #define Z_SortKey_elementSpec 1
1137 #define Z_SortKey_sortAttributes 2
1141 Z_Specification *elementSpec;
1142 Z_SortAttributes *sortAttributes;
1146 typedef struct Z_SortDbSpecific
1152 typedef struct Z_SortDbSpecificList
1155 Z_SortDbSpecific **dbSpecific;
1156 } Z_SortDbSpecificList;
1158 typedef struct Z_SortElement
1161 #define Z_SortElement_generic 0
1162 #define Z_SortElement_databaseSpecific 1
1166 Z_SortDbSpecificList *databaseSpecific;
1170 typedef struct Z_SortMissingValueAction
1173 #define Z_SortMissingValAct_abort 0
1174 #define Z_SortMissingValAct_null 1
1175 #define Z_SortMissingValAct_valData 2
1182 } Z_SortMissingValueAction;
1184 typedef struct Z_SortKeySpec
1186 Z_SortElement *sortElement;
1188 #define Z_SortRelation_ascending 0
1189 #define Z_SortRelation_descending 1
1190 #define Z_SortRelation_ascendingByFreq 3
1191 #define Z_SortRelation_descendingByFreq 4
1192 int *caseSensitivity;
1193 #define Z_SortCase_caseSensitive 0
1194 #define Z_SortCase_caseInsensitive 1
1195 Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
1198 typedef struct Z_SortResponse
1200 Z_ReferenceId *referenceId; /* OPTIONAL */
1202 #define Z_SortStatus_success 0
1203 #define Z_SortStatus_partial_1 1
1204 #define Z_SortStatus_failure 2
1205 int *resultSetStatus; /* OPTIONAL */
1206 #define Z_SortResultSetStatus_empty 1
1207 #define Z_SortResultSetStatus_interim 2
1208 #define Z_SortResultSetStatus_unchanged 3
1209 #define Z_SortResultSetStatus_none 4
1210 Z_DiagRecs *diagnostics; /* OPTIONAL */
1211 Z_OtherInformation *otherInfo; /* OPTIONAL */
1214 typedef struct Z_SortKeySpecList
1217 Z_SortKeySpec **specs;
1218 } Z_SortKeySpecList;
1220 typedef struct Z_SortRequest
1222 Z_ReferenceId *referenceId; /* OPTIONAL */
1223 Z_StringList *inputResultSetNames;
1224 char *sortedResultSetName;
1225 Z_SortKeySpecList *sortSequence;
1226 Z_OtherInformation *otherInfo; /* OPTIONAL */
1229 /* ----------------------- Resource Report ------------------ */
1231 typedef struct Z_ResourceReportRequest
1233 Z_ReferenceId *referenceId; /* OPTIONAL */
1234 Z_ReferenceId *opId; /* OPTIONAL */
1235 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
1236 Z_OtherInformation *otherInfo; /* OPTIONAL */
1237 } Z_ResourceReportRequest;
1239 typedef struct Z_ResourceReportResponse
1241 Z_ReferenceId *referenceId; /* OPTIONAL */
1242 int *resourceReportStatus;
1243 #define Z_ResourceReportStatus_success 0
1244 #define Z_ResourceReportStatus_partial 1
1245 #define Z_ResourceReportStatus_failure_1 2
1246 #define Z_ResourceReportStatus_failure_2 3
1247 #define Z_ResourceReportStatus_failure_3 4
1248 #define Z_ResourceReportStatus_failure_4 5
1249 #define Z_ResourceReportStatus_failure_5 6
1250 #define Z_ResourceReportStatus_failure_6 7
1251 Z_External *resourceReport; /* OPTIONAL */
1252 Z_OtherInformation *otherInfo; /* OPTIONAL */
1253 } Z_ResourceReportResponse;
1255 /* ------------------------ APDU ---------------------------- */
1257 typedef struct Z_APDU
1260 #define Z_APDU_initRequest 0
1261 #define Z_APDU_initResponse 1
1262 #define Z_APDU_searchRequest 2
1263 #define Z_APDU_searchResponse 3
1264 #define Z_APDU_presentRequest 4
1265 #define Z_APDU_presentResponse 5
1266 #define Z_APDU_deleteResultSetRequest 6
1267 #define Z_APDU_deleteResultSetResponse 7
1268 #define Z_APDU_resourceControlRequest 8
1269 #define Z_APDU_resourceControlResponse 9
1270 #define Z_APDU_triggerResourceControlRequest 10
1271 #define Z_APDU_scanRequest 11
1272 #define Z_APDU_scanResponse 12
1273 #define Z_APDU_segmentRequest 13
1274 #define Z_APDU_extendedServicesRequest 14
1275 #define Z_APDU_extendedServicesResponse 15
1276 #define Z_APDU_close 16
1277 #define Z_APDU_accessControlRequest 17
1278 #define Z_APDU_accessControlResponse 18
1279 #define Z_APDU_sortRequest 20
1280 #define Z_APDU_sortResponse 21
1281 #define Z_APDU_resourceReportRequest 22
1282 #define Z_APDU_resourceReportResponse 23
1285 Z_InitRequest *initRequest;
1286 Z_InitResponse *initResponse;
1287 Z_SearchRequest *searchRequest;
1288 Z_SearchResponse *searchResponse;
1289 Z_PresentRequest *presentRequest;
1290 Z_PresentResponse *presentResponse;
1291 Z_DeleteResultSetRequest *deleteResultSetRequest;
1292 Z_DeleteResultSetResponse *deleteResultSetResponse;
1293 Z_AccessControlRequest *accessControlRequest;
1294 Z_AccessControlResponse *accessControlResponse;
1295 Z_ResourceControlRequest *resourceControlRequest;
1296 Z_ResourceControlResponse *resourceControlResponse;
1297 Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1298 Z_ResourceReportRequest *resourceReportRequest;
1299 Z_ResourceReportResponse *resourceReportResponse;
1300 Z_ScanRequest *scanRequest;
1301 Z_ScanResponse *scanResponse;
1302 Z_SortRequest *sortRequest;
1303 Z_SortResponse *sortResponse;
1304 Z_Segment *segmentRequest;
1305 Z_ExtendedServicesRequest *extendedServicesRequest;
1306 Z_ExtendedServicesResponse *extendedServicesResponse;
1311 int z_APDU(ODR o, Z_APDU **p, int opt);
1312 int z_SUTRS(ODR o, Odr_oct **p, int opt);
1314 Z_InitRequest *zget_InitRequest(ODR o);
1315 Z_InitResponse *zget_InitResponse(ODR o);
1316 Z_SearchRequest *zget_SearchRequest(ODR o);
1317 Z_SearchResponse *zget_SearchResponse(ODR o);
1318 Z_PresentRequest *zget_PresentRequest(ODR o);
1319 Z_PresentResponse *zget_PresentResponse(ODR o);
1320 Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1321 Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1322 Z_ScanRequest *zget_ScanRequest(ODR o);
1323 Z_ScanResponse *zget_ScanResponse(ODR o);
1324 Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1325 Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1326 Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1327 Z_Close *zget_Close(ODR o);
1328 int z_StringList(ODR o, Z_StringList **p, int opt);
1329 int z_InternationalString(ODR o, char **p, int opt);
1330 int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt);
1331 int z_ElementSetName(ODR o, char **p, int opt);
1332 int z_IntUnit(ODR o, Z_IntUnit **p, int opt);
1333 int z_Unit(ODR o, Z_Unit **p, int opt);
1334 int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt);
1335 int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt);
1336 int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt);
1337 int z_Term(ODR o, Z_Term **p, int opt);
1338 int z_Specification(ODR o, Z_Specification **p, int opt);
1339 int z_Permissions(ODR o, Z_Permissions **p, int opt);
1340 int z_DiagRec(ODR o, Z_DiagRec **p, int opt);
1341 int z_AttributeList(ODR o, Z_AttributeList **p, int opt);
1342 int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt);
1343 Z_APDU *zget_APDU(ODR o, int which);
1345 #include <prt-rsc.h>
1346 #include <prt-acc.h>
1347 #include <prt-exp.h>
1348 #include <prt-grs.h>
1349 #include <prt-arc.h>
1350 #include <prt-exd.h>
1351 #include <prt-dia.h>
1352 #include <prt-esp.h>
1354 #include <prt-ext.h>