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.32 1996-02-20 12:52:39 quinn
30 * Revision 1.31 1996/01/22 09:46:45 quinn
31 * Added Sort PDU. Moved StringList to main protocol file.
33 * Revision 1.30 1996/01/10 15:21:32 quinn
34 * Added links to access control PDUs
36 * Revision 1.29 1996/01/02 11:46:49 quinn
37 * Changed 'operator' to 'roperator' to avoid C++ conflict.
40 * Revision 1.28 1996/01/02 08:57:32 quinn
41 * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
43 * Revision 1.27 1995/10/12 10:34:46 quinn
46 * Revision 1.26 1995/09/29 17:12:08 quinn
49 * Revision 1.25 1995/09/27 15:02:49 quinn
50 * Modified function heads & prototypes.
52 * Revision 1.24 1995/08/29 11:17:43 quinn
53 * *** empty log message ***
55 * Revision 1.23 1995/08/21 09:10:36 quinn
56 * Smallish fixes to suppport new formats.
58 * Revision 1.22 1995/08/17 12:45:14 quinn
59 * Fixed minor problems with GRS-1. Added support in c&s.
61 * Revision 1.21 1995/08/15 12:00:11 quinn
64 * Revision 1.20 1995/08/10 08:54:35 quinn
67 * Revision 1.19 1995/06/19 12:38:28 quinn
68 * Reorganized include-files. Added small features.
70 * Revision 1.18 1995/06/16 13:16:05 quinn
71 * Fixed Defaultdiagformat.
73 * Revision 1.17 1995/06/15 15:42:05 quinn
76 * Revision 1.16 1995/06/15 07:45:06 quinn
79 * Revision 1.15 1995/06/14 15:26:43 quinn
80 * *** empty log message ***
82 * Revision 1.14 1995/06/07 14:42:34 quinn
85 * Revision 1.13 1995/06/07 14:36:47 quinn
88 * Revision 1.12 1995/06/05 10:53:13 quinn
91 * Revision 1.11 1995/06/02 09:49:47 quinn
94 * Revision 1.10 1995/05/29 08:11:34 quinn
95 * Moved oid from odr/asn to util.
97 * Revision 1.9 1995/05/22 11:31:25 quinn
100 * Revision 1.8 1995/05/17 08:41:35 quinn
101 * Added delete to proto & other little things.
102 * Relaying auth info to backend.
104 * Revision 1.7 1995/05/16 08:50:37 quinn
105 * License, documentation, and memory fixes
107 * Revision 1.6 1995/05/15 11:55:55 quinn
108 * Work on asynchronous activity.
110 * Revision 1.5 1995/04/17 11:28:18 quinn
113 * Revision 1.4 1995/04/10 10:22:47 quinn
116 * Revision 1.3 1995/03/30 12:18:09 quinn
119 * Revision 1.2 1995/03/30 10:26:48 quinn
120 * Added Term structure
122 * Revision 1.1 1995/03/30 09:39:42 quinn
123 * Moved .h files to include directory
125 * Revision 1.11 1995/03/30 09:08:44 quinn
126 * Added Resource control protocol
128 * Revision 1.10 1995/03/29 15:39:39 quinn
129 * Adding some resource control elements, and a null-check to getentbyoid
131 * Revision 1.9 1995/03/29 08:06:18 quinn
132 * Added a few v3 elements
134 * Revision 1.8 1995/03/22 10:12:49 quinn
135 * Added Z_PRES constants.
137 * Revision 1.7 1995/03/20 09:45:12 quinn
140 * Revision 1.5 1995/03/07 16:29:34 quinn
141 * Added authentication stuff.
143 * Revision 1.4 1995/03/07 10:13:00 quinn
144 * Added prototype for z_APDU()
146 * Revision 1.3 1995/02/14 11:54:23 quinn
149 * Revision 1.2 1995/02/09 15:51:40 quinn
152 * Revision 1.1 1995/02/06 16:44:48 quinn
153 * First hack at Z/SR protocol
164 #include <yaz-version.h>
167 * Because we didn't have time to put all of the extra v3 elements in here
168 * before the first applications were written, we have to place them
169 * in #ifdefs in places where they would break existing code. If you are
170 * developing new stuff, we urge you to leave them in, even if you don't
171 * intend to use any v3 features. When we are comfortable that the old
172 * apps have been updated, we'll remove the #ifdefs.
177 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
180 typedef struct Z_External Z_External;
182 typedef Odr_oct Z_ReferenceId;
183 typedef char Z_DatabaseName;
184 typedef char Z_ResultSetId;
185 typedef Odr_oct Z_ResultsetId;
187 typedef struct Z_InfoCategory
189 Odr_oid *categoryTypeId; /* OPTIONAL */
193 typedef struct Z_OtherInformationUnit
195 Z_InfoCategory *category; /* OPTIONAL */
197 #define Z_OtherInfo_characterInfo 0
198 #define Z_OtherInfo_binaryInfo 1
199 #define Z_OtherInfo_externallyDefinedInfo 2
200 #define Z_OtherInfo_oid 3
205 Z_External *externallyDefinedInfo;
208 } Z_OtherInformationUnit;
210 typedef struct Z_OtherInformation
213 Z_OtherInformationUnit **list;
214 } Z_OtherInformation;
216 typedef struct Z_StringOrNumeric
219 #define Z_StringOrNumeric_string 0
220 #define Z_StringOrNumeric_numeric 1
228 typedef struct Z_Unit
230 char *unitSystem; /* OPTIONAL */
231 Z_StringOrNumeric *unitType; /* OPTIONAL */
232 Z_StringOrNumeric *unit; /* OPTIONAL */
233 int *scaleFactor; /* OPTIONAL */
236 typedef struct Z_IntUnit
242 typedef Odr_oct Z_SUTRS;
244 typedef struct Z_StringList
250 /* ----------------- INIT SERVICE ----------------*/
254 char *groupId; /* OPTIONAL */
255 char *userId; /* OPTIONAL */
256 char *password; /* OPTIONAL */
259 typedef struct Z_IdAuthentication
262 #define Z_IdAuthentication_open 0
263 #define Z_IdAuthentication_idPass 1
264 #define Z_IdAuthentication_anonymous 2
265 #define Z_IdAuthentication_other 3
273 } Z_IdAuthentication;
275 #define Z_ProtocolVersion_1 0
276 #define Z_ProtocolVersion_2 1
277 #define Z_ProtocolVersion_3 2
279 #define Z_Options_search 0
280 #define Z_Options_present 1
281 #define Z_Options_delSet 2
282 #define Z_Options_resourceReport 3
283 #define Z_Options_triggerResourceCtrl 4
284 #define Z_Options_resourceCtrl 5
285 #define Z_Options_accessCtrl 6
286 #define Z_Options_scan 7
287 #define Z_Options_sort 8
288 #define Z_Options_reserved 9
289 #define Z_Options_extendedServices 10
290 #define Z_Options_level_1Segmentation 11
291 #define Z_Options_level_2Segmentation 12
292 #define Z_Options_concurrentOperations 13
293 #define Z_Options_namedResultSets 14
295 typedef struct Z_InitRequest
297 Z_ReferenceId *referenceId; /* OPTIONAL */
298 Odr_bitmask *protocolVersion;
299 Odr_bitmask *options;
300 int *preferredMessageSize;
301 int *maximumRecordSize;
302 Z_IdAuthentication* idAuthentication; /* OPTIONAL */
303 char *implementationId; /* OPTIONAL */
304 char *implementationName; /* OPTIONAL */
305 char *implementationVersion; /* OPTIONAL */
306 Z_External *userInformationField; /* OPTIONAL */
308 Z_OtherInformation *otherInfo; /* OPTIONAL */
312 typedef struct Z_InitResponse
314 Z_ReferenceId *referenceId; /* OPTIONAL */
315 Odr_bitmask *protocolVersion;
316 Odr_bitmask *options;
317 int *preferredMessageSize;
318 int *maximumRecordSize;
320 char *implementationId; /* OPTIONAL */
321 char *implementationName; /* OPTIONAL */
322 char *implementationVersion; /* OPTIONAL */
323 Z_External *userInformationField; /* OPTIONAL */
325 Z_OtherInformation *otherInfo; /* OPTIONAL */
329 typedef struct Z_NSRAuthentication
334 } Z_NSRAuthentication;
336 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
338 int z_StrAuthentication(ODR o, char **p, int opt);
340 /* ------------------ SEARCH SERVICE ----------------*/
342 typedef struct Z_DatabaseSpecificUnit
345 char *elementSetName;
346 } Z_DatabaseSpecificUnit;
348 typedef struct Z_DatabaseSpecific
351 Z_DatabaseSpecificUnit **elements;
352 } Z_DatabaseSpecific;
354 typedef struct Z_ElementSetNames
357 #define Z_ElementSetNames_generic 0
358 #define Z_ElementSetNames_databaseSpecific 1
362 Z_DatabaseSpecific *databaseSpecific;
366 /* ---------------------- RPN QUERY --------------------------- */
368 typedef struct Z_ComplexAttribute
371 Z_StringOrNumeric **list;
372 int num_semanticAction;
373 int **semanticAction; /* OPTIONAL */
374 } Z_ComplexAttribute;
376 typedef struct Z_AttributeElement
379 Odr_oid *attributeSet; /* OPTIONAL - v3 only */
384 #define Z_AttributeValue_numeric 0
385 #define Z_AttributeValue_complex 1
389 Z_ComplexAttribute *complex;
394 } Z_AttributeElement;
396 typedef struct Z_Term
399 #define Z_Term_general 0
400 #define Z_Term_numeric 1
401 #define Z_Term_characterString 2
403 #define Z_Term_dateTime 4
404 #define Z_Term_external 5
405 #define Z_Term_integerAndUnit 6
406 #define Z_Term_null 7
409 Odr_oct *general; /* this is required for v2 */
411 char *characterString;
414 Z_External *external;
415 /* Z_IntUnit *integerAndUnit; */
420 typedef struct Z_AttributesPlusTerm
423 Z_AttributeElement **attributeList;
425 } Z_AttributesPlusTerm;
427 typedef struct Z_ResultSetPlusAttributes
431 Z_AttributeElement **attributeList;
432 } Z_ResultSetPlusAttributes;
434 typedef struct Z_ProximityOperator
436 bool_t *exclusion; /* OPTIONAL */
440 #define Z_Prox_lessThan 1
441 #define Z_Prox_lessThanOrEqual 2
442 #define Z_Prox_equal 3
443 #define Z_Prox_greaterThanOrEqual 4
444 #define Z_Prox_greaterThan 5
445 #define Z_Prox_notEqual 6
447 #define Z_ProxCode_known 0
448 #define Z_ProxCode_private 1
449 int *proximityUnitCode;
450 #define Z_ProxUnit_character 1
451 #define Z_ProxUnit_word 2
452 #define Z_ProxUnit_sentence 3
453 #define Z_ProxUnit_paragraph 4
454 #define Z_ProxUnit_section 5
455 #define Z_ProxUnit_chapter 6
456 #define Z_ProxUnit_document 7
457 #define Z_ProxUnit_element 8
458 #define Z_ProxUnit_subelement 9
459 #define Z_ProxUnit_elementType 10
460 #define Z_ProxUnit_byte 11 /* v3 only */
461 } Z_ProximityOperator;
463 typedef struct Z_Operator
466 #define Z_Operator_and 0
467 #define Z_Operator_or 1
468 #define Z_Operator_and_not 2
469 #define Z_Operator_prox 3
472 Odr_null *and; /* these guys are nulls. */
475 Z_ProximityOperator *prox;
479 typedef struct Z_Operand
482 #define Z_Operand_APT 0
483 #define Z_Operand_resultSetId 1
484 #define Z_Operand_resultAttr /* v3 only */ 2
487 Z_AttributesPlusTerm *attributesPlusTerm;
488 Z_ResultSetId *resultSetId;
489 Z_ResultSetPlusAttributes *resultAttr;
493 typedef struct Z_Complex
495 struct Z_RPNStructure *s1;
496 struct Z_RPNStructure *s2;
497 Z_Operator *roperator;
500 typedef struct Z_RPNStructure
503 #define Z_RPNStructure_simple 0
504 #define Z_RPNStructure_complex 1
512 typedef struct Z_RPNQuery
514 Odr_oid *attributeSetId;
515 Z_RPNStructure *RPNStructure;
518 /* -------------------------- SEARCHREQUEST -------------------------- */
520 typedef struct Z_Query
523 #define Z_Query_type_1 1
524 #define Z_Query_type_2 2
525 #define Z_Query_type_101 3
530 Z_RPNQuery *type_101;
534 typedef struct Z_SearchRequest
536 Z_ReferenceId *referenceId; /* OPTIONAL */
537 int *smallSetUpperBound;
538 int *largeSetLowerBound;
539 int *mediumSetPresentNumber;
540 bool_t *replaceIndicator;
542 int num_databaseNames;
543 char **databaseNames;
544 Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */
545 Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */
546 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
549 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */
550 Z_OtherInformation *otherInfo; /* OPTIONAL */
554 /* ------------------------ RECORD -------------------------- */
556 typedef Z_External Z_DatabaseRecord;
560 typedef struct Z_DefaultDiagFormat
562 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
564 /* until the whole character set issue becomes more definite,
565 * you can probably ignore this on input. */
567 #define Z_DiagForm_v2AddInfo 0
568 #define Z_DiagForm_v3AddInfo 1
570 } Z_DefaultDiagFormat;
572 typedef struct Z_DiagRec
575 #define Z_DiagRec_defaultFormat 0
576 #define Z_DiagRec_externallyDefined 1
579 Z_DefaultDiagFormat *defaultFormat;
580 Z_External *externallyDefined;
586 typedef struct Z_DiagRec
588 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
595 typedef struct Z_DiagRecs
598 Z_DiagRec **diagRecs;
601 typedef struct Z_NamePlusRecord
603 char *databaseName; /* OPTIONAL */
605 #define Z_NamePlusRecord_databaseRecord 0
606 #define Z_NamePlusRecord_surrogateDiagnostic 1
609 Z_DatabaseRecord *databaseRecord;
610 Z_DiagRec *surrogateDiagnostic;
614 typedef struct Z_NamePlusRecordList
617 Z_NamePlusRecord **records;
618 } Z_NamePlusRecordList;
620 typedef struct Z_Records
623 #define Z_Records_DBOSD 0
624 #define Z_Records_NSD 1
625 #define Z_Records_multipleNSD 2
628 Z_NamePlusRecordList *databaseOrSurDiagnostics;
629 Z_DiagRec *nonSurrogateDiagnostic;
630 Z_DiagRecs *multipleNonSurDiagnostics;
634 /* ------------------------ SEARCHRESPONSE ------------------ */
636 typedef struct Z_SearchResponse
638 Z_ReferenceId *referenceId; /* OPTIONAL */
640 int *numberOfRecordsReturned;
641 int *nextResultSetPosition;
642 bool_t *searchStatus;
643 int *resultSetStatus; /* OPTIONAL */
644 #define Z_RES_SUBSET 1
645 #define Z_RES_INTERIM 2
647 int *presentStatus; /* OPTIONAL */
648 #define Z_PRES_SUCCESS 0
649 #define Z_PRES_PARTIAL_1 1
650 #define Z_PRES_PARTIAL_2 2
651 #define Z_PRES_PARTIAL_3 3
652 #define Z_PRES_PARTIAL_4 4
653 #define Z_PRES_FAILURE 5
654 Z_Records *records; /* OPTIONAL */
656 Z_OtherInformation *additionalSearchInfo;
657 Z_OtherInformation *otherInfo;
661 /* ------------------------- PRESENT SERVICE -----------------*/
663 typedef struct Z_ElementSpec
666 #define Z_ElementSpec_elementSetName 0
667 #define Z_ElementSpec_externalSpec 1
670 char *elementSetName;
671 Z_External *externalSpec;
675 typedef struct Z_Specification
677 Odr_oid *schema; /* OPTIONAL */
678 Z_ElementSpec *elementSpec; /* OPTIONAL */
681 typedef struct Z_DbSpecific
684 Z_Specification *spec;
687 typedef struct Z_CompSpec
689 bool_t *selectAlternativeSyntax;
690 Z_Specification *generic; /* OPTIONAL */
692 Z_DbSpecific **dbSpecific; /* OPTIONAL */
693 int num_recordSyntax;
694 Odr_oid **recordSyntax; /* OPTIONAL */
697 typedef struct Z_RecordComposition
700 #define Z_RecordComp_simple 0
701 #define Z_RecordComp_complex 1
704 Z_ElementSetNames *simple;
707 } Z_RecordComposition;
709 typedef struct Z_Range
711 int *startingPosition;
712 int *numberOfRecords;
715 typedef struct Z_PresentRequest
717 Z_ReferenceId *referenceId; /* OPTIONAL */
718 Z_ResultSetId *resultSetId;
719 int *resultSetStartPoint;
720 int *numberOfRecordsRequested;
723 Z_Range **additionalRanges; /* OPTIONAL */
724 Z_RecordComposition *recordComposition; /* OPTIONAL */
726 Z_ElementSetNames *elementSetNames; /* OPTIONAL */
728 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
730 int *maxSegmentCount; /* OPTIONAL */
731 int *maxRecordSize; /* OPTIONAL */
732 int *maxSegmentSize; /* OPTIONAL */
733 Z_OtherInformation *otherInfo; /* OPTIONAL */
737 typedef struct Z_PresentResponse
739 Z_ReferenceId *referenceId; /* OPTIONAL */
740 int *numberOfRecordsReturned;
741 int *nextResultSetPosition;
745 Z_OtherInformation *otherInfo; /* OPTIONAL */
749 /* ------------------ RESOURCE CONTROL ----------------*/
751 typedef struct Z_TriggerResourceControlRequest
753 Z_ReferenceId *referenceId; /* OPTIONAL */
754 int *requestedAction;
755 #define Z_TriggerResourceCtrl_resourceReport 1
756 #define Z_TriggerResourceCtrl_resourceControl 2
757 #define Z_TriggerResourceCtrl_cancel 3
758 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
759 bool_t *resultSetWanted; /* OPTIONAL */
761 Z_OtherInformation *otherInfo;
763 } Z_TriggerResourceControlRequest;
765 typedef struct Z_ResourceControlRequest
767 Z_ReferenceId *referenceId; /* OPTIONAL */
768 bool_t *suspendedFlag; /* OPTIONAL */
769 Z_External *resourceReport; /* OPTIONAL */
770 int *partialResultsAvailable; /* OPTIONAL */
771 #define Z_ResourceControlRequest_subset 1
772 #define Z_ResourceControlRequest_interim 2
773 #define Z_ResourceControlRequest_none 3
774 bool_t *responseRequired;
775 bool_t *triggeredRequestFlag; /* OPTIONAL */
777 Z_OtherInformation *otherInfo;
779 } Z_ResourceControlRequest;
781 typedef struct Z_ResourceControlResponse
783 Z_ReferenceId *referenceId; /* OPTIONAL */
784 bool_t *continueFlag;
785 bool_t *resultSetWanted; /* OPTIONAL */
787 Z_OtherInformation *otherInfo;
789 } Z_ResourceControlResponse;
792 /* ------------------ ACCESS CTRL SERVICE ----------------*/
794 typedef struct Z_AccessControlRequest
796 Z_ReferenceId *referenceId; /* OPTIONAL */
798 #define Z_AccessRequest_simpleForm 0
799 #define Z_AccessRequest_externallyDefined 1
803 Z_External *externallyDefined;
806 Z_OtherInformation *otherInfo; /* OPTIONAL */
808 } Z_AccessControlRequest;
810 typedef struct Z_AccessControlResponse
812 Z_ReferenceId *referenceId; /* OPTIONAL */
814 #define Z_AccessResponse_simpleForm 0
815 #define Z_AccessResponse_externallyDefined 1
819 Z_External *externallyDefined;
821 Z_DiagRec *diagnostic; /* OPTIONAL */
823 Z_OtherInformation *otherInfo; /* OPTIONAL */
825 } Z_AccessControlResponse;
827 /* ------------------------ SCAN SERVICE -------------------- */
829 typedef struct Z_AttributeList
832 Z_AttributeElement **attributes;
835 typedef struct Z_AlternativeTerm
838 Z_AttributesPlusTerm **terms;
843 typedef struct Z_ByDatabase
846 int *num; /* OPTIONAL */
847 Z_OtherInformation *otherDbInfo; /* OPTIONAL */
850 typedef struct Z_ByDatabaseList
853 Z_ByDatabase **elements;
856 typedef struct Z_ScanOccurrences
859 #define Z_ScanOccurrences_global 0
860 #define Z_ScanOccurrences_byDatabase 1
864 Z_ByDatabaseList *byDatabase;
869 typedef struct Z_OccurrenceByAttributes
871 Z_AttributeList *attributes;
872 Z_ScanOccurrences *occurrences; /* OPTIONAL */
873 Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
874 } Z_OccurrenceByAttributes;
879 * Old, incomplete definition of OccurrenceByAttributes.
882 typedef struct Z_OccurrenceByAttributes
884 Z_AttributeList *attributes;
887 #define Z_OByAtt_global 0
888 #define Z_ObyAtt_byDatabase 1
894 /* Z_ByDatabase *byDatabase; */
897 } Z_OccurrenceByAttributes;
901 typedef struct Z_TermInfo
904 char *displayTerm; /* OPTIONAL */
905 Z_AttributeList *suggestedAttributes; /* OPTIONAL */
906 Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
907 int *globalOccurrences; /* OPTIONAL */
908 Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
909 Z_OtherInformation *otherTermInfo; /* OPTIONAL */
912 typedef struct Z_Entry
915 #define Z_Entry_termInfo 0
916 #define Z_Entry_surrogateDiagnostic 1
919 Z_TermInfo *termInfo;
920 Z_DiagRec *surrogateDiagnostic;
924 typedef struct Z_Entries
930 typedef struct Z_ListEntries
933 #define Z_ListEntries_entries 0
934 #define Z_ListEntries_nonSurrogateDiagnostics 1
938 Z_DiagRecs *nonSurrogateDiagnostics;
942 typedef struct Z_ScanRequest
944 Z_ReferenceId *referenceId; /* OPTIONAL */
945 int num_databaseNames;
946 char **databaseNames;
947 Odr_oid *attributeSet; /* OPTIONAL */
948 Z_AttributesPlusTerm *termListAndStartPoint;
949 int *stepSize; /* OPTIONAL */
950 int *numberOfTermsRequested;
951 int *preferredPositionInResponse; /* OPTIONAL */
953 Z_OtherInformation *otherInfo;
957 typedef struct Z_ScanResponse
959 Z_ReferenceId *referenceId; /* OPTIONAL */
960 int *stepSize; /* OPTIONAL */
962 #define Z_Scan_success 0
963 #define Z_Scan_partial_1 1
964 #define Z_Scan_partial_2 2
965 #define Z_Scan_partial_3 3
966 #define Z_Scan_partial_4 4
967 #define Z_Scan_partial_5 5
968 #define Z_Scan_failure 6
969 int *numberOfEntriesReturned;
970 int *positionOfTerm; /* OPTIONAL */
971 Z_ListEntries *entries; /* OPTIONAL */
972 Odr_oid *attributeSet; /* OPTIONAL */
974 Z_OtherInformation *otherInfo;
979 /* ------------------------ DELETE -------------------------- */
981 #define Z_DeleteStatus_success 0
982 #define Z_DeleteStatus_resultSetDidNotExist 1
983 #define Z_DeleteStatus_previouslyDeletedByTarget 2
984 #define Z_DeleteStatus_systemProblemAtTarget 3
985 #define Z_DeleteStatus_accessNotAllowed 4
986 #define Z_DeleteStatus_resourceControlAtOrigin 5
987 #define Z_DeleteStatus_resourceControlAtTarget 6
988 #define Z_DeleteStatus_bulkDeleteNotSupported 7
989 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
990 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
991 #define Z_DeleteStatus_resultSetInUse 10
993 typedef struct Z_ListStatus
999 typedef struct Z_DeleteResultSetRequest
1001 Z_ReferenceId *referenceId; /* OPTIONAL */
1002 int *deleteFunction;
1003 #define Z_DeleteRequest_list 0
1004 #define Z_DeleteRequest_all 1
1006 Z_ResultSetId **resultSetList; /* OPTIONAL */
1008 Z_OtherInformation *otherInfo;
1010 } Z_DeleteResultSetRequest;
1012 typedef struct Z_DeleteResultSetResponse
1014 Z_ReferenceId *referenceId; /* OPTIONAL */
1015 int *deleteOperationStatus;
1017 Z_ListStatus *deleteListStatuses; /* OPTIONAL */
1018 int *numberNotDeleted; /* OPTIONAL */
1019 int num_bulkStatuses;
1020 Z_ListStatus *bulkStatuses; /* OPTIONAL */
1021 char *deleteMessage; /* OPTIONAL */
1023 Z_OtherInformation *otherInfo;
1025 } Z_DeleteResultSetResponse;
1027 /* ------------------------ CLOSE SERVICE ------------------- */
1029 typedef struct Z_Close
1031 Z_ReferenceId *referenceId; /* OPTIONAL */
1033 #define Z_Close_finished 0
1034 #define Z_Close_shutdown 1
1035 #define Z_Close_systemProblem 2
1036 #define Z_Close_costLimit 3
1037 #define Z_Close_resources 4
1038 #define Z_Close_securityViolation 5
1039 #define Z_Close_protocolError 6
1040 #define Z_Close_lackOfActivity 7
1041 #define Z_Close_peerAbort 8
1042 #define Z_Close_unspecified 9
1043 char *diagnosticInformation; /* OPTIONAL */
1044 Odr_oid *resourceReportFormat; /* OPTIONAL */
1045 Z_External *resourceReport; /* OPTIONAL */
1047 Z_OtherInformation *otherInfo; /* OPTIONAL */
1051 /* ------------------------ SEGMENTATION -------------------- */
1053 typedef struct Z_Segment
1055 Z_ReferenceId *referenceId; /* OPTIONAL */
1056 int *numberOfRecordsReturned;
1057 int num_segmentRecords;
1058 Z_NamePlusRecord **segmentRecords;
1059 Z_OtherInformation *otherInfo; /* OPTIONAL */
1062 /* ----------------------- Extended Services ---------------- */
1064 typedef struct Z_Permissions
1067 int num_allowableFunctions;
1068 int **allowableFunctions;
1069 #define Z_Permissions_delete 1
1070 #define Z_Permissions_modifyContents 2
1071 #define Z_Permissions_modifyPermissions 3
1072 #define Z_Permissions_present 4
1073 #define Z_Permissions_invoke 5
1076 typedef struct Z_ExtendedServicesRequest
1078 Z_ReferenceId *referenceId; /* OPTIONAL */
1080 #define Z_ExtendedServicesRequest_create 1
1081 #define Z_ExtendedServicesRequest_delete 2
1082 #define Z_ExtendedServicesRequest_modify 3
1083 Odr_oid *packageType;
1084 char *packageName; /* OPTIONAL */
1085 char *userId; /* OPTIONAL */
1086 Z_IntUnit *retentionTime; /* OPTIONAL */
1087 Z_Permissions *permissions; /* OPTIONAL */
1088 char *description; /* OPTIONAL */
1089 Z_External *taskSpecificParameters; /* OPTIONAL */
1091 #define Z_ExtendedServicesRequest_wait 1
1092 #define Z_ExtendedServicesRequest_waitIfPossible 2
1093 #define Z_ExtendedServicesRequest_dontWait 3
1094 #define Z_ExtendedServicesRequest_dontReturnPackage 4
1095 char *elements; /* OPTIONAL */
1096 Z_OtherInformation *otherInfo; /* OPTIONAL */
1097 } Z_ExtendedServicesRequest;
1099 typedef struct Z_ExtendedServicesResponse
1101 Z_ReferenceId *referenceId; /* OPTIONAL */
1102 int *operationStatus;
1103 #define Z_ExtendedServicesResponse_done 1
1104 #define Z_ExtendedServicesResponse_accepted 2
1105 #define Z_ExtendedServicesResponse_failure 3
1106 int num_diagnostics;
1107 Z_DiagRec **diagnostics; /* OPTIONAL */
1108 Z_External *taskPackage; /* OPTIONAL */
1109 Z_OtherInformation *otherInfo; /* OPTIONAL */
1110 } Z_ExtendedServicesResponse;
1112 /* ------------------------ Sort --------------------------- */
1114 typedef struct Z_SortAttributes
1117 Z_AttributeList *list;
1120 typedef struct Z_SortKey
1123 #define Z_SortKey_sortField 0
1124 #define Z_SortKey_elementSpec 1
1125 #define Z_SortKey_sortAttributes 2
1129 Z_Specification *elementSpec;
1130 Z_SortAttributes *sortAttributes;
1134 typedef struct Z_SortDbSpecific
1140 typedef struct Z_SortDbSpecificList
1143 Z_SortDbSpecific **dbSpecific;
1144 } Z_SortDbSpecificList;
1146 typedef struct Z_SortElement
1149 #define Z_SortElement_generic 0
1150 #define Z_SortElement_databaseSpecific 1
1154 Z_SortDbSpecificList *databaseSpecific;
1158 typedef struct Z_SortMissingValueAction
1161 #define Z_SortMissingValAct_abort 0
1162 #define Z_SortMissingValAct_null 1
1163 #define Z_SortMissingValAct_valData 2
1170 } Z_SortMissingValueAction;
1172 typedef struct Z_SortKeySpec
1174 Z_SortElement *sortElement;
1176 #define Z_SortRelation_ascending 0
1177 #define Z_SortRelation_descending 1
1178 #define Z_SortRelation_ascendingByFreq 3
1179 #define Z_SortRelation_descendingByFreq 4
1180 int *caseSensitivity;
1181 #define Z_SortCase_caseSensitive 0
1182 #define Z_SortCase_caseInsensitive 1
1183 Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
1186 typedef struct Z_SortResponse
1188 Z_ReferenceId *referenceId; /* OPTIONAL */
1190 #define Z_SortStatus_success 0
1191 #define Z_SortStatus_partial_1 1
1192 #define Z_SortStatus_failure 2
1193 int *resultSetStatus; /* OPTIONAL */
1194 #define Z_SortResultSetStatus_empty 1
1195 #define Z_SortResultSetStatus_interim 2
1196 #define Z_SortResultSetStatus_unchanged 3
1197 #define Z_SortResultSetStatus_none 4
1198 Z_DiagRecs *diagnostics; /* OPTIONAL */
1199 Z_OtherInformation *otherInfo; /* OPTIONAL */
1202 typedef struct Z_SortKeySpecList
1205 Z_SortKeySpec **specs;
1206 } Z_SortKeySpecList;
1208 typedef struct Z_SortRequest
1210 Z_ReferenceId *referenceId; /* OPTIONAL */
1211 Z_StringList *inputResultSetNames;
1212 char *sortedResultSetName;
1213 Z_SortKeySpecList *sortSequence;
1214 Z_OtherInformation *otherInfo; /* OPTIONAL */
1217 /* ------------------------ APDU ---------------------------- */
1219 typedef struct Z_APDU
1222 #define Z_APDU_initRequest 0
1223 #define Z_APDU_initResponse 1
1224 #define Z_APDU_searchRequest 2
1225 #define Z_APDU_searchResponse 3
1226 #define Z_APDU_presentRequest 4
1227 #define Z_APDU_presentResponse 5
1228 #define Z_APDU_deleteResultSetRequest 6
1229 #define Z_APDU_deleteResultSetResponse 7
1230 #define Z_APDU_resourceControlRequest 8
1231 #define Z_APDU_resourceControlResponse 9
1232 #define Z_APDU_triggerResourceControlRequest 10
1233 #define Z_APDU_scanRequest 11
1234 #define Z_APDU_scanResponse 12
1235 #define Z_APDU_segmentRequest 13
1236 #define Z_APDU_extendedServicesRequest 14
1237 #define Z_APDU_extendedServicesResponse 15
1238 #define Z_APDU_close 16
1239 #define Z_APDU_accessControlRequest 17
1240 #define Z_APDU_accessControlResponse 18
1241 #define Z_APDU_sortRequest 20
1242 #define Z_APDU_sortResponse 21
1245 Z_InitRequest *initRequest;
1246 Z_InitResponse *initResponse;
1247 Z_SearchRequest *searchRequest;
1248 Z_SearchResponse *searchResponse;
1249 Z_PresentRequest *presentRequest;
1250 Z_PresentResponse *presentResponse;
1251 Z_DeleteResultSetRequest *deleteResultSetRequest;
1252 Z_DeleteResultSetResponse *deleteResultSetResponse;
1253 Z_AccessControlRequest *accessControlRequest;
1254 Z_AccessControlResponse *accessControlResponse;
1255 Z_ResourceControlRequest *resourceControlRequest;
1256 Z_ResourceControlResponse *resourceControlResponse;
1257 Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1258 Z_ScanRequest *scanRequest;
1259 Z_ScanResponse *scanResponse;
1260 Z_SortRequest *sortRequest;
1261 Z_SortResponse *sortResponse;
1262 Z_Segment *segmentRequest;
1263 Z_ExtendedServicesRequest *extendedServicesRequest;
1264 Z_ExtendedServicesResponse *extendedServicesResponse;
1269 int z_APDU(ODR o, Z_APDU **p, int opt);
1270 int z_SUTRS(ODR o, Odr_oct **p, int opt);
1272 Z_InitRequest *zget_InitRequest(ODR o);
1273 Z_InitResponse *zget_InitResponse(ODR o);
1274 Z_SearchRequest *zget_SearchRequest(ODR o);
1275 Z_SearchResponse *zget_SearchResponse(ODR o);
1276 Z_PresentRequest *zget_PresentRequest(ODR o);
1277 Z_PresentResponse *zget_PresentResponse(ODR o);
1278 Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1279 Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1280 Z_ScanRequest *zget_ScanRequest(ODR o);
1281 Z_ScanResponse *zget_ScanResponse(ODR o);
1282 Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1283 Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1284 Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1285 Z_Close *zget_Close(ODR o);
1286 int z_StringList(ODR o, Z_StringList **p, int opt);
1287 int z_InternationalString(ODR o, char **p, int opt);
1288 int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt);
1289 int z_ElementSetName(ODR o, char **p, int opt);
1290 int z_IntUnit(ODR o, Z_IntUnit **p, int opt);
1291 int z_Unit(ODR o, Z_Unit **p, int opt);
1292 int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt);
1293 int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt);
1294 int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt);
1295 int z_Term(ODR o, Z_Term **p, int opt);
1296 int z_Specification(ODR o, Z_Specification **p, int opt);
1297 int z_Permissions(ODR o, Z_Permissions **p, int opt);
1298 int z_DiagRec(ODR o, Z_DiagRec **p, int opt);
1299 int z_AttributeList(ODR o, Z_AttributeList **p, int opt);
1300 int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt);
1301 Z_APDU *zget_APDU(ODR o, int which);
1303 #include <prt-rsc.h>
1304 #include <prt-acc.h>
1305 #include <prt-exp.h>
1306 #include <prt-grs.h>
1307 #include <prt-exd.h>
1308 #include <prt-dia.h>
1309 #include <prt-esp.h>
1311 #include <prt-ext.h>