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.36 1996-10-07 15:29:20 quinn
30 * Revision 1.35 1996/06/10 08:57:38 quinn
31 * Added OPAC, ResourceReport
33 * Revision 1.34 1996/06/10 08:55:36 quinn
36 * Revision 1.33 1996/02/23 10:00:51 quinn
39 * Revision 1.32 1996/02/20 12:52:39 quinn
42 * Revision 1.31 1996/01/22 09:46:45 quinn
43 * Added Sort PDU. Moved StringList to main protocol file.
45 * Revision 1.30 1996/01/10 15:21:32 quinn
46 * Added links to access control PDUs
48 * Revision 1.29 1996/01/02 11:46:49 quinn
49 * Changed 'operator' to 'roperator' to avoid C++ conflict.
52 * Revision 1.28 1996/01/02 08:57:32 quinn
53 * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
55 * Revision 1.27 1995/10/12 10:34:46 quinn
58 * Revision 1.26 1995/09/29 17:12:08 quinn
61 * Revision 1.25 1995/09/27 15:02:49 quinn
62 * Modified function heads & prototypes.
64 * Revision 1.24 1995/08/29 11:17:43 quinn
65 * *** empty log message ***
67 * Revision 1.23 1995/08/21 09:10:36 quinn
68 * Smallish fixes to suppport new formats.
70 * Revision 1.22 1995/08/17 12:45:14 quinn
71 * Fixed minor problems with GRS-1. Added support in c&s.
73 * Revision 1.21 1995/08/15 12:00:11 quinn
76 * Revision 1.20 1995/08/10 08:54:35 quinn
79 * Revision 1.19 1995/06/19 12:38:28 quinn
80 * Reorganized include-files. Added small features.
82 * Revision 1.18 1995/06/16 13:16:05 quinn
83 * Fixed Defaultdiagformat.
85 * Revision 1.17 1995/06/15 15:42:05 quinn
88 * Revision 1.16 1995/06/15 07:45:06 quinn
91 * Revision 1.15 1995/06/14 15:26:43 quinn
92 * *** empty log message ***
94 * Revision 1.14 1995/06/07 14:42:34 quinn
97 * Revision 1.13 1995/06/07 14:36:47 quinn
100 * Revision 1.12 1995/06/05 10:53:13 quinn
103 * Revision 1.11 1995/06/02 09:49:47 quinn
106 * Revision 1.10 1995/05/29 08:11:34 quinn
107 * Moved oid from odr/asn to util.
109 * Revision 1.9 1995/05/22 11:31:25 quinn
112 * Revision 1.8 1995/05/17 08:41:35 quinn
113 * Added delete to proto & other little things.
114 * Relaying auth info to backend.
116 * Revision 1.7 1995/05/16 08:50:37 quinn
117 * License, documentation, and memory fixes
119 * Revision 1.6 1995/05/15 11:55:55 quinn
120 * Work on asynchronous activity.
122 * Revision 1.5 1995/04/17 11:28:18 quinn
125 * Revision 1.4 1995/04/10 10:22:47 quinn
128 * Revision 1.3 1995/03/30 12:18:09 quinn
131 * Revision 1.2 1995/03/30 10:26:48 quinn
132 * Added Term structure
134 * Revision 1.1 1995/03/30 09:39:42 quinn
135 * Moved .h files to include directory
137 * Revision 1.11 1995/03/30 09:08:44 quinn
138 * Added Resource control protocol
140 * Revision 1.10 1995/03/29 15:39:39 quinn
141 * Adding some resource control elements, and a null-check to getentbyoid
143 * Revision 1.9 1995/03/29 08:06:18 quinn
144 * Added a few v3 elements
146 * Revision 1.8 1995/03/22 10:12:49 quinn
147 * Added Z_PRES constants.
149 * Revision 1.7 1995/03/20 09:45:12 quinn
152 * Revision 1.5 1995/03/07 16:29:34 quinn
153 * Added authentication stuff.
155 * Revision 1.4 1995/03/07 10:13:00 quinn
156 * Added prototype for z_APDU()
158 * Revision 1.3 1995/02/14 11:54:23 quinn
161 * Revision 1.2 1995/02/09 15:51:40 quinn
164 * Revision 1.1 1995/02/06 16:44:48 quinn
165 * First hack at Z/SR protocol
176 #include <yaz-version.h>
179 * Because we didn't have time to put all of the extra v3 elements in here
180 * before the first applications were written, we have to place them
181 * in #ifdefs in places where they would break existing code. If you are
182 * developing new stuff, we urge you to leave them in, even if you don't
183 * intend to use any v3 features. When we are comfortable that the old
184 * apps have been updated, we'll remove the #ifdefs.
189 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
192 typedef struct Z_External Z_External;
194 typedef Odr_oct Z_ReferenceId;
195 typedef char Z_DatabaseName;
196 typedef char Z_ResultSetId;
197 typedef Odr_oct Z_ResultsetId;
199 typedef struct Z_InfoCategory
201 Odr_oid *categoryTypeId; /* OPTIONAL */
205 typedef struct Z_OtherInformationUnit
207 Z_InfoCategory *category; /* OPTIONAL */
209 #define Z_OtherInfo_characterInfo 0
210 #define Z_OtherInfo_binaryInfo 1
211 #define Z_OtherInfo_externallyDefinedInfo 2
212 #define Z_OtherInfo_oid 3
217 Z_External *externallyDefinedInfo;
220 } Z_OtherInformationUnit;
222 typedef struct Z_OtherInformation
225 Z_OtherInformationUnit **list;
226 } Z_OtherInformation;
228 typedef struct Z_StringOrNumeric
231 #define Z_StringOrNumeric_string 0
232 #define Z_StringOrNumeric_numeric 1
240 typedef struct Z_Unit
242 char *unitSystem; /* OPTIONAL */
243 Z_StringOrNumeric *unitType; /* OPTIONAL */
244 Z_StringOrNumeric *unit; /* OPTIONAL */
245 int *scaleFactor; /* OPTIONAL */
248 typedef struct Z_IntUnit
254 typedef Odr_oct Z_SUTRS;
256 typedef struct Z_StringList
262 /* ----------------- INIT SERVICE ----------------*/
266 char *groupId; /* OPTIONAL */
267 char *userId; /* OPTIONAL */
268 char *password; /* OPTIONAL */
271 typedef struct Z_IdAuthentication
274 #define Z_IdAuthentication_open 0
275 #define Z_IdAuthentication_idPass 1
276 #define Z_IdAuthentication_anonymous 2
277 #define Z_IdAuthentication_other 3
285 } Z_IdAuthentication;
287 #define Z_ProtocolVersion_1 0
288 #define Z_ProtocolVersion_2 1
289 #define Z_ProtocolVersion_3 2
291 #define Z_Options_search 0
292 #define Z_Options_present 1
293 #define Z_Options_delSet 2
294 #define Z_Options_resourceReport 3
295 #define Z_Options_triggerResourceCtrl 4
296 #define Z_Options_resourceCtrl 5
297 #define Z_Options_accessCtrl 6
298 #define Z_Options_scan 7
299 #define Z_Options_sort 8
300 #define Z_Options_reserved 9
301 #define Z_Options_extendedServices 10
302 #define Z_Options_level_1Segmentation 11
303 #define Z_Options_level_2Segmentation 12
304 #define Z_Options_concurrentOperations 13
305 #define Z_Options_namedResultSets 14
307 typedef struct Z_InitRequest
309 Z_ReferenceId *referenceId; /* OPTIONAL */
310 Odr_bitmask *protocolVersion;
311 Odr_bitmask *options;
312 int *preferredMessageSize;
313 int *maximumRecordSize;
314 Z_IdAuthentication* idAuthentication; /* OPTIONAL */
315 char *implementationId; /* OPTIONAL */
316 char *implementationName; /* OPTIONAL */
317 char *implementationVersion; /* OPTIONAL */
318 Z_External *userInformationField; /* OPTIONAL */
320 Z_OtherInformation *otherInfo; /* OPTIONAL */
324 typedef struct Z_InitResponse
326 Z_ReferenceId *referenceId; /* OPTIONAL */
327 Odr_bitmask *protocolVersion;
328 Odr_bitmask *options;
329 int *preferredMessageSize;
330 int *maximumRecordSize;
332 char *implementationId; /* OPTIONAL */
333 char *implementationName; /* OPTIONAL */
334 char *implementationVersion; /* OPTIONAL */
335 Z_External *userInformationField; /* OPTIONAL */
337 Z_OtherInformation *otherInfo; /* OPTIONAL */
341 typedef struct Z_NSRAuthentication
346 } Z_NSRAuthentication;
348 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
350 int z_StrAuthentication(ODR o, char **p, int opt);
352 /* ------------------ SEARCH SERVICE ----------------*/
354 typedef struct Z_DatabaseSpecificUnit
357 char *elementSetName;
358 } Z_DatabaseSpecificUnit;
360 typedef struct Z_DatabaseSpecific
363 Z_DatabaseSpecificUnit **elements;
364 } Z_DatabaseSpecific;
366 typedef struct Z_ElementSetNames
369 #define Z_ElementSetNames_generic 0
370 #define Z_ElementSetNames_databaseSpecific 1
374 Z_DatabaseSpecific *databaseSpecific;
378 /* ---------------------- RPN QUERY --------------------------- */
380 typedef struct Z_ComplexAttribute
383 Z_StringOrNumeric **list;
384 int num_semanticAction;
385 int **semanticAction; /* OPTIONAL */
386 } Z_ComplexAttribute;
388 typedef struct Z_AttributeElement
391 Odr_oid *attributeSet; /* OPTIONAL - v3 only */
396 #define Z_AttributeValue_numeric 0
397 #define Z_AttributeValue_complex 1
401 Z_ComplexAttribute *complex;
406 } Z_AttributeElement;
408 typedef struct Z_Term
411 #define Z_Term_general 0
412 #define Z_Term_numeric 1
413 #define Z_Term_characterString 2
415 #define Z_Term_dateTime 4
416 #define Z_Term_external 5
417 #define Z_Term_integerAndUnit 6
418 #define Z_Term_null 7
421 Odr_oct *general; /* this is required for v2 */
423 char *characterString;
426 Z_External *external;
427 /* Z_IntUnit *integerAndUnit; */
432 typedef struct Z_AttributesPlusTerm
435 Z_AttributeElement **attributeList;
437 } Z_AttributesPlusTerm;
439 typedef struct Z_ResultSetPlusAttributes
443 Z_AttributeElement **attributeList;
444 } Z_ResultSetPlusAttributes;
446 typedef struct Z_ProximityOperator
448 bool_t *exclusion; /* OPTIONAL */
452 #define Z_Prox_lessThan 1
453 #define Z_Prox_lessThanOrEqual 2
454 #define Z_Prox_equal 3
455 #define Z_Prox_greaterThanOrEqual 4
456 #define Z_Prox_greaterThan 5
457 #define Z_Prox_notEqual 6
459 #define Z_ProxCode_known 0
460 #define Z_ProxCode_private 1
461 int *proximityUnitCode;
462 #define Z_ProxUnit_character 1
463 #define Z_ProxUnit_word 2
464 #define Z_ProxUnit_sentence 3
465 #define Z_ProxUnit_paragraph 4
466 #define Z_ProxUnit_section 5
467 #define Z_ProxUnit_chapter 6
468 #define Z_ProxUnit_document 7
469 #define Z_ProxUnit_element 8
470 #define Z_ProxUnit_subelement 9
471 #define Z_ProxUnit_elementType 10
472 #define Z_ProxUnit_byte 11 /* v3 only */
473 } Z_ProximityOperator;
475 typedef struct Z_Operator
478 #define Z_Operator_and 0
479 #define Z_Operator_or 1
480 #define Z_Operator_and_not 2
481 #define Z_Operator_prox 3
484 Odr_null *and; /* these guys are nulls. */
487 Z_ProximityOperator *prox;
491 typedef struct Z_Operand
494 #define Z_Operand_APT 0
495 #define Z_Operand_resultSetId 1
496 #define Z_Operand_resultAttr /* v3 only */ 2
499 Z_AttributesPlusTerm *attributesPlusTerm;
500 Z_ResultSetId *resultSetId;
501 Z_ResultSetPlusAttributes *resultAttr;
505 typedef struct Z_Complex
507 struct Z_RPNStructure *s1;
508 struct Z_RPNStructure *s2;
509 Z_Operator *roperator;
512 typedef struct Z_RPNStructure
515 #define Z_RPNStructure_simple 0
516 #define Z_RPNStructure_complex 1
524 typedef struct Z_RPNQuery
526 Odr_oid *attributeSetId;
527 Z_RPNStructure *RPNStructure;
530 /* -------------------------- SEARCHREQUEST -------------------------- */
532 typedef struct Z_Query
535 #define Z_Query_type_1 1
536 #define Z_Query_type_2 2
537 #define Z_Query_type_101 3
542 Z_RPNQuery *type_101;
546 typedef struct Z_SearchRequest
548 Z_ReferenceId *referenceId; /* OPTIONAL */
549 int *smallSetUpperBound;
550 int *largeSetLowerBound;
551 int *mediumSetPresentNumber;
552 bool_t *replaceIndicator;
554 int num_databaseNames;
555 char **databaseNames;
556 Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */
557 Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */
558 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
561 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */
562 Z_OtherInformation *otherInfo; /* OPTIONAL */
566 /* ------------------------ RECORD -------------------------- */
568 typedef Z_External Z_DatabaseRecord;
572 typedef struct Z_DefaultDiagFormat
574 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
576 /* until the whole character set issue becomes more definite,
577 * you can probably ignore this on input. */
579 #define Z_DiagForm_v2AddInfo 0
580 #define Z_DiagForm_v3AddInfo 1
582 } Z_DefaultDiagFormat;
584 typedef struct Z_DiagRec
587 #define Z_DiagRec_defaultFormat 0
588 #define Z_DiagRec_externallyDefined 1
591 Z_DefaultDiagFormat *defaultFormat;
592 Z_External *externallyDefined;
598 typedef struct Z_DiagRec
600 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
607 typedef struct Z_DiagRecs
610 Z_DiagRec **diagRecs;
613 typedef struct Z_NamePlusRecord
615 char *databaseName; /* OPTIONAL */
617 #define Z_NamePlusRecord_databaseRecord 0
618 #define Z_NamePlusRecord_surrogateDiagnostic 1
621 Z_DatabaseRecord *databaseRecord;
622 Z_DiagRec *surrogateDiagnostic;
626 typedef struct Z_NamePlusRecordList
629 Z_NamePlusRecord **records;
630 } Z_NamePlusRecordList;
632 typedef struct Z_Records
635 #define Z_Records_DBOSD 0
636 #define Z_Records_NSD 1
637 #define Z_Records_multipleNSD 2
640 Z_NamePlusRecordList *databaseOrSurDiagnostics;
641 Z_DiagRec *nonSurrogateDiagnostic;
642 Z_DiagRecs *multipleNonSurDiagnostics;
646 /* ------------------------ SEARCHRESPONSE ------------------ */
648 typedef struct Z_SearchResponse
650 Z_ReferenceId *referenceId; /* OPTIONAL */
652 int *numberOfRecordsReturned;
653 int *nextResultSetPosition;
654 bool_t *searchStatus;
655 int *resultSetStatus; /* OPTIONAL */
656 #define Z_RES_SUBSET 1
657 #define Z_RES_INTERIM 2
659 int *presentStatus; /* OPTIONAL */
660 #define Z_PRES_SUCCESS 0
661 #define Z_PRES_PARTIAL_1 1
662 #define Z_PRES_PARTIAL_2 2
663 #define Z_PRES_PARTIAL_3 3
664 #define Z_PRES_PARTIAL_4 4
665 #define Z_PRES_FAILURE 5
666 Z_Records *records; /* OPTIONAL */
668 Z_OtherInformation *additionalSearchInfo;
669 Z_OtherInformation *otherInfo;
673 /* ------------------------- PRESENT SERVICE -----------------*/
675 typedef struct Z_ElementSpec
678 #define Z_ElementSpec_elementSetName 0
679 #define Z_ElementSpec_externalSpec 1
682 char *elementSetName;
683 Z_External *externalSpec;
687 typedef struct Z_Specification
689 Odr_oid *schema; /* OPTIONAL */
690 Z_ElementSpec *elementSpec; /* OPTIONAL */
693 typedef struct Z_DbSpecific
696 Z_Specification *spec;
699 typedef struct Z_CompSpec
701 bool_t *selectAlternativeSyntax;
702 Z_Specification *generic; /* OPTIONAL */
704 Z_DbSpecific **dbSpecific; /* OPTIONAL */
705 int num_recordSyntax;
706 Odr_oid **recordSyntax; /* OPTIONAL */
709 typedef struct Z_RecordComposition
712 #define Z_RecordComp_simple 0
713 #define Z_RecordComp_complex 1
716 Z_ElementSetNames *simple;
719 } Z_RecordComposition;
721 typedef struct Z_Range
723 int *startingPosition;
724 int *numberOfRecords;
727 typedef struct Z_PresentRequest
729 Z_ReferenceId *referenceId; /* OPTIONAL */
730 Z_ResultSetId *resultSetId;
731 int *resultSetStartPoint;
732 int *numberOfRecordsRequested;
735 Z_Range **additionalRanges; /* OPTIONAL */
736 Z_RecordComposition *recordComposition; /* OPTIONAL */
738 Z_ElementSetNames *elementSetNames; /* OPTIONAL */
740 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
742 int *maxSegmentCount; /* OPTIONAL */
743 int *maxRecordSize; /* OPTIONAL */
744 int *maxSegmentSize; /* OPTIONAL */
745 Z_OtherInformation *otherInfo; /* OPTIONAL */
749 typedef struct Z_PresentResponse
751 Z_ReferenceId *referenceId; /* OPTIONAL */
752 int *numberOfRecordsReturned;
753 int *nextResultSetPosition;
757 Z_OtherInformation *otherInfo; /* OPTIONAL */
761 /* ------------------ RESOURCE CONTROL ----------------*/
763 typedef struct Z_TriggerResourceControlRequest
765 Z_ReferenceId *referenceId; /* OPTIONAL */
766 int *requestedAction;
767 #define Z_TriggerResourceCtrl_resourceReport 1
768 #define Z_TriggerResourceCtrl_resourceControl 2
769 #define Z_TriggerResourceCtrl_cancel 3
770 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
771 bool_t *resultSetWanted; /* OPTIONAL */
773 Z_OtherInformation *otherInfo;
775 } Z_TriggerResourceControlRequest;
777 typedef struct Z_ResourceControlRequest
779 Z_ReferenceId *referenceId; /* OPTIONAL */
780 bool_t *suspendedFlag; /* OPTIONAL */
781 Z_External *resourceReport; /* OPTIONAL */
782 int *partialResultsAvailable; /* OPTIONAL */
783 #define Z_ResourceControlRequest_subset 1
784 #define Z_ResourceControlRequest_interim 2
785 #define Z_ResourceControlRequest_none 3
786 bool_t *responseRequired;
787 bool_t *triggeredRequestFlag; /* OPTIONAL */
789 Z_OtherInformation *otherInfo;
791 } Z_ResourceControlRequest;
793 typedef struct Z_ResourceControlResponse
795 Z_ReferenceId *referenceId; /* OPTIONAL */
796 bool_t *continueFlag;
797 bool_t *resultSetWanted; /* OPTIONAL */
799 Z_OtherInformation *otherInfo;
801 } Z_ResourceControlResponse;
804 /* ------------------ ACCESS CTRL SERVICE ----------------*/
806 typedef struct Z_AccessControlRequest
808 Z_ReferenceId *referenceId; /* OPTIONAL */
810 #define Z_AccessRequest_simpleForm 0
811 #define Z_AccessRequest_externallyDefined 1
815 Z_External *externallyDefined;
818 Z_OtherInformation *otherInfo; /* OPTIONAL */
820 } Z_AccessControlRequest;
822 typedef struct Z_AccessControlResponse
824 Z_ReferenceId *referenceId; /* OPTIONAL */
826 #define Z_AccessResponse_simpleForm 0
827 #define Z_AccessResponse_externallyDefined 1
831 Z_External *externallyDefined;
833 Z_DiagRec *diagnostic; /* OPTIONAL */
835 Z_OtherInformation *otherInfo; /* OPTIONAL */
837 } Z_AccessControlResponse;
839 /* ------------------------ SCAN SERVICE -------------------- */
841 typedef struct Z_AttributeList
844 Z_AttributeElement **attributes;
847 typedef struct Z_AlternativeTerm
850 Z_AttributesPlusTerm **terms;
855 typedef struct Z_ByDatabase
858 int *num; /* OPTIONAL */
859 Z_OtherInformation *otherDbInfo; /* OPTIONAL */
862 typedef struct Z_ByDatabaseList
865 Z_ByDatabase **elements;
868 typedef struct Z_ScanOccurrences
871 #define Z_ScanOccurrences_global 0
872 #define Z_ScanOccurrences_byDatabase 1
876 Z_ByDatabaseList *byDatabase;
881 typedef struct Z_OccurrenceByAttributesElem
883 Z_AttributeList *attributes;
884 Z_ScanOccurrences *occurrences; /* OPTIONAL */
885 Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
886 } Z_OccurrenceByAttributesElem;
888 typedef struct Z_OccurrenceByAttributes
891 Z_OccurrenceByAttributesElem **elements;
892 } Z_OccurrenceByAttributes;
897 * Old, incomplete definition of OccurrenceByAttributes.
900 typedef struct Z_OccurrenceByAttributes
902 Z_AttributeList *attributes;
905 #define Z_OByAtt_global 0
906 #define Z_ObyAtt_byDatabase 1
912 /* Z_ByDatabase *byDatabase; */
915 } Z_OccurrenceByAttributes;
919 typedef struct Z_TermInfo
922 char *displayTerm; /* OPTIONAL */
923 Z_AttributeList *suggestedAttributes; /* OPTIONAL */
924 Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
925 int *globalOccurrences; /* OPTIONAL */
926 Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
927 Z_OtherInformation *otherTermInfo; /* OPTIONAL */
930 typedef struct Z_Entry
933 #define Z_Entry_termInfo 0
934 #define Z_Entry_surrogateDiagnostic 1
937 Z_TermInfo *termInfo;
938 Z_DiagRec *surrogateDiagnostic;
942 typedef struct Z_Entries
948 typedef struct Z_ListEntries
951 #define Z_ListEntries_entries 0
952 #define Z_ListEntries_nonSurrogateDiagnostics 1
956 Z_DiagRecs *nonSurrogateDiagnostics;
960 typedef struct Z_ScanRequest
962 Z_ReferenceId *referenceId; /* OPTIONAL */
963 int num_databaseNames;
964 char **databaseNames;
965 Odr_oid *attributeSet; /* OPTIONAL */
966 Z_AttributesPlusTerm *termListAndStartPoint;
967 int *stepSize; /* OPTIONAL */
968 int *numberOfTermsRequested;
969 int *preferredPositionInResponse; /* OPTIONAL */
971 Z_OtherInformation *otherInfo;
975 typedef struct Z_ScanResponse
977 Z_ReferenceId *referenceId; /* OPTIONAL */
978 int *stepSize; /* OPTIONAL */
980 #define Z_Scan_success 0
981 #define Z_Scan_partial_1 1
982 #define Z_Scan_partial_2 2
983 #define Z_Scan_partial_3 3
984 #define Z_Scan_partial_4 4
985 #define Z_Scan_partial_5 5
986 #define Z_Scan_failure 6
987 int *numberOfEntriesReturned;
988 int *positionOfTerm; /* OPTIONAL */
989 Z_ListEntries *entries; /* OPTIONAL */
990 Odr_oid *attributeSet; /* OPTIONAL */
992 Z_OtherInformation *otherInfo;
997 /* ------------------------ DELETE -------------------------- */
999 #define Z_DeleteStatus_success 0
1000 #define Z_DeleteStatus_resultSetDidNotExist 1
1001 #define Z_DeleteStatus_previouslyDeletedByTarget 2
1002 #define Z_DeleteStatus_systemProblemAtTarget 3
1003 #define Z_DeleteStatus_accessNotAllowed 4
1004 #define Z_DeleteStatus_resourceControlAtOrigin 5
1005 #define Z_DeleteStatus_resourceControlAtTarget 6
1006 #define Z_DeleteStatus_bulkDeleteNotSupported 7
1007 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
1008 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
1009 #define Z_DeleteStatus_resultSetInUse 10
1011 typedef struct Z_ListStatus
1017 typedef struct Z_DeleteResultSetRequest
1019 Z_ReferenceId *referenceId; /* OPTIONAL */
1020 int *deleteFunction;
1021 #define Z_DeleteRequest_list 0
1022 #define Z_DeleteRequest_all 1
1024 Z_ResultSetId **resultSetList; /* OPTIONAL */
1026 Z_OtherInformation *otherInfo;
1028 } Z_DeleteResultSetRequest;
1030 typedef struct Z_DeleteResultSetResponse
1032 Z_ReferenceId *referenceId; /* OPTIONAL */
1033 int *deleteOperationStatus;
1035 Z_ListStatus **deleteListStatuses; /* OPTIONAL */
1036 int *numberNotDeleted; /* OPTIONAL */
1037 int num_bulkStatuses;
1038 Z_ListStatus **bulkStatuses; /* OPTIONAL */
1039 char *deleteMessage; /* OPTIONAL */
1041 Z_OtherInformation *otherInfo;
1043 } Z_DeleteResultSetResponse;
1045 /* ------------------------ CLOSE SERVICE ------------------- */
1047 typedef struct Z_Close
1049 Z_ReferenceId *referenceId; /* OPTIONAL */
1051 #define Z_Close_finished 0
1052 #define Z_Close_shutdown 1
1053 #define Z_Close_systemProblem 2
1054 #define Z_Close_costLimit 3
1055 #define Z_Close_resources 4
1056 #define Z_Close_securityViolation 5
1057 #define Z_Close_protocolError 6
1058 #define Z_Close_lackOfActivity 7
1059 #define Z_Close_peerAbort 8
1060 #define Z_Close_unspecified 9
1061 char *diagnosticInformation; /* OPTIONAL */
1062 Odr_oid *resourceReportFormat; /* OPTIONAL */
1063 Z_External *resourceReport; /* OPTIONAL */
1065 Z_OtherInformation *otherInfo; /* OPTIONAL */
1069 /* ------------------------ SEGMENTATION -------------------- */
1071 typedef struct Z_Segment
1073 Z_ReferenceId *referenceId; /* OPTIONAL */
1074 int *numberOfRecordsReturned;
1075 int num_segmentRecords;
1076 Z_NamePlusRecord **segmentRecords;
1077 Z_OtherInformation *otherInfo; /* OPTIONAL */
1080 /* ----------------------- Extended Services ---------------- */
1082 typedef struct Z_Permissions
1085 int num_allowableFunctions;
1086 int **allowableFunctions;
1087 #define Z_Permissions_delete 1
1088 #define Z_Permissions_modifyContents 2
1089 #define Z_Permissions_modifyPermissions 3
1090 #define Z_Permissions_present 4
1091 #define Z_Permissions_invoke 5
1094 typedef struct Z_ExtendedServicesRequest
1096 Z_ReferenceId *referenceId; /* OPTIONAL */
1098 #define Z_ExtendedServicesRequest_create 1
1099 #define Z_ExtendedServicesRequest_delete 2
1100 #define Z_ExtendedServicesRequest_modify 3
1101 Odr_oid *packageType;
1102 char *packageName; /* OPTIONAL */
1103 char *userId; /* OPTIONAL */
1104 Z_IntUnit *retentionTime; /* OPTIONAL */
1105 Z_Permissions *permissions; /* OPTIONAL */
1106 char *description; /* OPTIONAL */
1107 Z_External *taskSpecificParameters; /* OPTIONAL */
1109 #define Z_ExtendedServicesRequest_wait 1
1110 #define Z_ExtendedServicesRequest_waitIfPossible 2
1111 #define Z_ExtendedServicesRequest_dontWait 3
1112 #define Z_ExtendedServicesRequest_dontReturnPackage 4
1113 char *elements; /* OPTIONAL */
1114 Z_OtherInformation *otherInfo; /* OPTIONAL */
1115 } Z_ExtendedServicesRequest;
1117 typedef struct Z_ExtendedServicesResponse
1119 Z_ReferenceId *referenceId; /* OPTIONAL */
1120 int *operationStatus;
1121 #define Z_ExtendedServicesResponse_done 1
1122 #define Z_ExtendedServicesResponse_accepted 2
1123 #define Z_ExtendedServicesResponse_failure 3
1124 int num_diagnostics;
1125 Z_DiagRec **diagnostics; /* OPTIONAL */
1126 Z_External *taskPackage; /* OPTIONAL */
1127 Z_OtherInformation *otherInfo; /* OPTIONAL */
1128 } Z_ExtendedServicesResponse;
1130 /* ------------------------ Sort --------------------------- */
1132 typedef struct Z_SortAttributes
1135 Z_AttributeList *list;
1138 typedef struct Z_SortKey
1141 #define Z_SortKey_sortField 0
1142 #define Z_SortKey_elementSpec 1
1143 #define Z_SortKey_sortAttributes 2
1147 Z_Specification *elementSpec;
1148 Z_SortAttributes *sortAttributes;
1152 typedef struct Z_SortDbSpecific
1158 typedef struct Z_SortDbSpecificList
1161 Z_SortDbSpecific **dbSpecific;
1162 } Z_SortDbSpecificList;
1164 typedef struct Z_SortElement
1167 #define Z_SortElement_generic 0
1168 #define Z_SortElement_databaseSpecific 1
1172 Z_SortDbSpecificList *databaseSpecific;
1176 typedef struct Z_SortMissingValueAction
1179 #define Z_SortMissingValAct_abort 0
1180 #define Z_SortMissingValAct_null 1
1181 #define Z_SortMissingValAct_valData 2
1188 } Z_SortMissingValueAction;
1190 typedef struct Z_SortKeySpec
1192 Z_SortElement *sortElement;
1194 #define Z_SortRelation_ascending 0
1195 #define Z_SortRelation_descending 1
1196 #define Z_SortRelation_ascendingByFreq 3
1197 #define Z_SortRelation_descendingByFreq 4
1198 int *caseSensitivity;
1199 #define Z_SortCase_caseSensitive 0
1200 #define Z_SortCase_caseInsensitive 1
1201 Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
1204 typedef struct Z_SortResponse
1206 Z_ReferenceId *referenceId; /* OPTIONAL */
1208 #define Z_SortStatus_success 0
1209 #define Z_SortStatus_partial_1 1
1210 #define Z_SortStatus_failure 2
1211 int *resultSetStatus; /* OPTIONAL */
1212 #define Z_SortResultSetStatus_empty 1
1213 #define Z_SortResultSetStatus_interim 2
1214 #define Z_SortResultSetStatus_unchanged 3
1215 #define Z_SortResultSetStatus_none 4
1216 Z_DiagRecs *diagnostics; /* OPTIONAL */
1217 Z_OtherInformation *otherInfo; /* OPTIONAL */
1220 typedef struct Z_SortKeySpecList
1223 Z_SortKeySpec **specs;
1224 } Z_SortKeySpecList;
1226 typedef struct Z_SortRequest
1228 Z_ReferenceId *referenceId; /* OPTIONAL */
1229 Z_StringList *inputResultSetNames;
1230 char *sortedResultSetName;
1231 Z_SortKeySpecList *sortSequence;
1232 Z_OtherInformation *otherInfo; /* OPTIONAL */
1235 /* ----------------------- Resource Report ------------------ */
1237 typedef struct Z_ResourceReportRequest
1239 Z_ReferenceId *referenceId; /* OPTIONAL */
1240 Z_ReferenceId *opId; /* OPTIONAL */
1241 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
1242 Z_OtherInformation *otherInfo; /* OPTIONAL */
1243 } Z_ResourceReportRequest;
1245 typedef struct Z_ResourceReportResponse
1247 Z_ReferenceId *referenceId; /* OPTIONAL */
1248 int *resourceReportStatus;
1249 #define Z_ResourceReportStatus_success 0
1250 #define Z_ResourceReportStatus_partial 1
1251 #define Z_ResourceReportStatus_failure_1 2
1252 #define Z_ResourceReportStatus_failure_2 3
1253 #define Z_ResourceReportStatus_failure_3 4
1254 #define Z_ResourceReportStatus_failure_4 5
1255 #define Z_ResourceReportStatus_failure_5 6
1256 #define Z_ResourceReportStatus_failure_6 7
1257 Z_External *resourceReport; /* OPTIONAL */
1258 Z_OtherInformation *otherInfo; /* OPTIONAL */
1259 } Z_ResourceReportResponse;
1261 /* ------------------------ APDU ---------------------------- */
1263 typedef struct Z_APDU
1266 #define Z_APDU_initRequest 0
1267 #define Z_APDU_initResponse 1
1268 #define Z_APDU_searchRequest 2
1269 #define Z_APDU_searchResponse 3
1270 #define Z_APDU_presentRequest 4
1271 #define Z_APDU_presentResponse 5
1272 #define Z_APDU_deleteResultSetRequest 6
1273 #define Z_APDU_deleteResultSetResponse 7
1274 #define Z_APDU_resourceControlRequest 8
1275 #define Z_APDU_resourceControlResponse 9
1276 #define Z_APDU_triggerResourceControlRequest 10
1277 #define Z_APDU_scanRequest 11
1278 #define Z_APDU_scanResponse 12
1279 #define Z_APDU_segmentRequest 13
1280 #define Z_APDU_extendedServicesRequest 14
1281 #define Z_APDU_extendedServicesResponse 15
1282 #define Z_APDU_close 16
1283 #define Z_APDU_accessControlRequest 17
1284 #define Z_APDU_accessControlResponse 18
1285 #define Z_APDU_sortRequest 20
1286 #define Z_APDU_sortResponse 21
1287 #define Z_APDU_resourceReportRequest 22
1288 #define Z_APDU_resourceReportResponse 23
1291 Z_InitRequest *initRequest;
1292 Z_InitResponse *initResponse;
1293 Z_SearchRequest *searchRequest;
1294 Z_SearchResponse *searchResponse;
1295 Z_PresentRequest *presentRequest;
1296 Z_PresentResponse *presentResponse;
1297 Z_DeleteResultSetRequest *deleteResultSetRequest;
1298 Z_DeleteResultSetResponse *deleteResultSetResponse;
1299 Z_AccessControlRequest *accessControlRequest;
1300 Z_AccessControlResponse *accessControlResponse;
1301 Z_ResourceControlRequest *resourceControlRequest;
1302 Z_ResourceControlResponse *resourceControlResponse;
1303 Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1304 Z_ResourceReportRequest *resourceReportRequest;
1305 Z_ResourceReportResponse *resourceReportResponse;
1306 Z_ScanRequest *scanRequest;
1307 Z_ScanResponse *scanResponse;
1308 Z_SortRequest *sortRequest;
1309 Z_SortResponse *sortResponse;
1310 Z_Segment *segmentRequest;
1311 Z_ExtendedServicesRequest *extendedServicesRequest;
1312 Z_ExtendedServicesResponse *extendedServicesResponse;
1317 int z_APDU(ODR o, Z_APDU **p, int opt);
1318 int z_SUTRS(ODR o, Odr_oct **p, int opt);
1320 Z_InitRequest *zget_InitRequest(ODR o);
1321 Z_InitResponse *zget_InitResponse(ODR o);
1322 Z_SearchRequest *zget_SearchRequest(ODR o);
1323 Z_SearchResponse *zget_SearchResponse(ODR o);
1324 Z_PresentRequest *zget_PresentRequest(ODR o);
1325 Z_PresentResponse *zget_PresentResponse(ODR o);
1326 Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1327 Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1328 Z_ScanRequest *zget_ScanRequest(ODR o);
1329 Z_ScanResponse *zget_ScanResponse(ODR o);
1330 Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1331 Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1332 Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1333 Z_Close *zget_Close(ODR o);
1334 int z_StringList(ODR o, Z_StringList **p, int opt);
1335 int z_InternationalString(ODR o, char **p, int opt);
1336 int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt);
1337 int z_ElementSetName(ODR o, char **p, int opt);
1338 int z_IntUnit(ODR o, Z_IntUnit **p, int opt);
1339 int z_Unit(ODR o, Z_Unit **p, int opt);
1340 int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt);
1341 int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt);
1342 int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt);
1343 int z_Term(ODR o, Z_Term **p, int opt);
1344 int z_Specification(ODR o, Z_Specification **p, int opt);
1345 int z_Permissions(ODR o, Z_Permissions **p, int opt);
1346 int z_DiagRec(ODR o, Z_DiagRec **p, int opt);
1347 int z_AttributeList(ODR o, Z_AttributeList **p, int opt);
1348 int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt);
1349 Z_APDU *zget_APDU(ODR o, int which);
1351 #include <prt-rsc.h>
1352 #include <prt-acc.h>
1353 #include <prt-exp.h>
1354 #include <prt-grs.h>
1355 #include <prt-arc.h>
1356 #include <prt-exd.h>
1357 #include <prt-dia.h>
1358 #include <prt-esp.h>
1360 #include <prt-ext.h>