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.38 1997-04-30 08:52:09 quinn
30 * Revision 1.37 1996/10/09 15:54:58 quinn
31 * Added SearchInfoReport
33 * Revision 1.36 1996/10/07 15:29:20 quinn
36 * Revision 1.35 1996/06/10 08:57:38 quinn
37 * Added OPAC, ResourceReport
39 * Revision 1.34 1996/06/10 08:55:36 quinn
42 * Revision 1.33 1996/02/23 10:00:51 quinn
45 * Revision 1.32 1996/02/20 12:52:39 quinn
48 * Revision 1.31 1996/01/22 09:46:45 quinn
49 * Added Sort PDU. Moved StringList to main protocol file.
51 * Revision 1.30 1996/01/10 15:21:32 quinn
52 * Added links to access control PDUs
54 * Revision 1.29 1996/01/02 11:46:49 quinn
55 * Changed 'operator' to 'roperator' to avoid C++ conflict.
58 * Revision 1.28 1996/01/02 08:57:32 quinn
59 * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
61 * Revision 1.27 1995/10/12 10:34:46 quinn
64 * Revision 1.26 1995/09/29 17:12:08 quinn
67 * Revision 1.25 1995/09/27 15:02:49 quinn
68 * Modified function heads & prototypes.
70 * Revision 1.24 1995/08/29 11:17:43 quinn
71 * *** empty log message ***
73 * Revision 1.23 1995/08/21 09:10:36 quinn
74 * Smallish fixes to suppport new formats.
76 * Revision 1.22 1995/08/17 12:45:14 quinn
77 * Fixed minor problems with GRS-1. Added support in c&s.
79 * Revision 1.21 1995/08/15 12:00:11 quinn
82 * Revision 1.20 1995/08/10 08:54:35 quinn
85 * Revision 1.19 1995/06/19 12:38:28 quinn
86 * Reorganized include-files. Added small features.
88 * Revision 1.18 1995/06/16 13:16:05 quinn
89 * Fixed Defaultdiagformat.
91 * Revision 1.17 1995/06/15 15:42:05 quinn
94 * Revision 1.16 1995/06/15 07:45:06 quinn
97 * Revision 1.15 1995/06/14 15:26:43 quinn
98 * *** empty log message ***
100 * Revision 1.14 1995/06/07 14:42:34 quinn
103 * Revision 1.13 1995/06/07 14:36:47 quinn
106 * Revision 1.12 1995/06/05 10:53:13 quinn
109 * Revision 1.11 1995/06/02 09:49:47 quinn
112 * Revision 1.10 1995/05/29 08:11:34 quinn
113 * Moved oid from odr/asn to util.
115 * Revision 1.9 1995/05/22 11:31:25 quinn
118 * Revision 1.8 1995/05/17 08:41:35 quinn
119 * Added delete to proto & other little things.
120 * Relaying auth info to backend.
122 * Revision 1.7 1995/05/16 08:50:37 quinn
123 * License, documentation, and memory fixes
125 * Revision 1.6 1995/05/15 11:55:55 quinn
126 * Work on asynchronous activity.
128 * Revision 1.5 1995/04/17 11:28:18 quinn
131 * Revision 1.4 1995/04/10 10:22:47 quinn
134 * Revision 1.3 1995/03/30 12:18:09 quinn
137 * Revision 1.2 1995/03/30 10:26:48 quinn
138 * Added Term structure
140 * Revision 1.1 1995/03/30 09:39:42 quinn
141 * Moved .h files to include directory
143 * Revision 1.11 1995/03/30 09:08:44 quinn
144 * Added Resource control protocol
146 * Revision 1.10 1995/03/29 15:39:39 quinn
147 * Adding some resource control elements, and a null-check to getentbyoid
149 * Revision 1.9 1995/03/29 08:06:18 quinn
150 * Added a few v3 elements
152 * Revision 1.8 1995/03/22 10:12:49 quinn
153 * Added Z_PRES constants.
155 * Revision 1.7 1995/03/20 09:45:12 quinn
158 * Revision 1.5 1995/03/07 16:29:34 quinn
159 * Added authentication stuff.
161 * Revision 1.4 1995/03/07 10:13:00 quinn
162 * Added prototype for z_APDU()
164 * Revision 1.3 1995/02/14 11:54:23 quinn
167 * Revision 1.2 1995/02/09 15:51:40 quinn
170 * Revision 1.1 1995/02/06 16:44:48 quinn
171 * First hack at Z/SR protocol
182 #include <yaz-version.h>
185 * Because we didn't have time to put all of the extra v3 elements in here
186 * before the first applications were written, we have to place them
187 * in #ifdefs in places where they would break existing code. If you are
188 * developing new stuff, we urge you to leave them in, even if you don't
189 * intend to use any v3 features. When we are comfortable that the old
190 * apps have been updated, we'll remove the #ifdefs.
195 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
198 typedef struct Z_External Z_External;
200 typedef Odr_oct Z_ReferenceId;
201 typedef char Z_DatabaseName;
202 typedef char Z_ResultSetId;
203 typedef Odr_oct Z_ResultsetId;
205 typedef struct Z_InfoCategory
207 Odr_oid *categoryTypeId; /* OPTIONAL */
211 typedef struct Z_OtherInformationUnit
213 Z_InfoCategory *category; /* OPTIONAL */
215 #define Z_OtherInfo_characterInfo 0
216 #define Z_OtherInfo_binaryInfo 1
217 #define Z_OtherInfo_externallyDefinedInfo 2
218 #define Z_OtherInfo_oid 3
223 Z_External *externallyDefinedInfo;
226 } Z_OtherInformationUnit;
228 typedef struct Z_OtherInformation
231 Z_OtherInformationUnit **list;
232 } Z_OtherInformation;
234 typedef struct Z_StringOrNumeric
237 #define Z_StringOrNumeric_string 0
238 #define Z_StringOrNumeric_numeric 1
246 typedef struct Z_Unit
248 char *unitSystem; /* OPTIONAL */
249 Z_StringOrNumeric *unitType; /* OPTIONAL */
250 Z_StringOrNumeric *unit; /* OPTIONAL */
251 int *scaleFactor; /* OPTIONAL */
254 typedef struct Z_IntUnit
260 typedef Odr_oct Z_SUTRS;
262 typedef struct Z_StringList
268 /* ----------------- INIT SERVICE ----------------*/
272 char *groupId; /* OPTIONAL */
273 char *userId; /* OPTIONAL */
274 char *password; /* OPTIONAL */
277 typedef struct Z_IdAuthentication
280 #define Z_IdAuthentication_open 0
281 #define Z_IdAuthentication_idPass 1
282 #define Z_IdAuthentication_anonymous 2
283 #define Z_IdAuthentication_other 3
291 } Z_IdAuthentication;
293 #define Z_ProtocolVersion_1 0
294 #define Z_ProtocolVersion_2 1
295 #define Z_ProtocolVersion_3 2
297 #define Z_Options_search 0
298 #define Z_Options_present 1
299 #define Z_Options_delSet 2
300 #define Z_Options_resourceReport 3
301 #define Z_Options_triggerResourceCtrl 4
302 #define Z_Options_resourceCtrl 5
303 #define Z_Options_accessCtrl 6
304 #define Z_Options_scan 7
305 #define Z_Options_sort 8
306 #define Z_Options_reserved 9
307 #define Z_Options_extendedServices 10
308 #define Z_Options_level_1Segmentation 11
309 #define Z_Options_level_2Segmentation 12
310 #define Z_Options_concurrentOperations 13
311 #define Z_Options_namedResultSets 14
313 typedef struct Z_InitRequest
315 Z_ReferenceId *referenceId; /* OPTIONAL */
316 Odr_bitmask *protocolVersion;
317 Odr_bitmask *options;
318 int *preferredMessageSize;
319 int *maximumRecordSize;
320 Z_IdAuthentication* idAuthentication; /* OPTIONAL */
321 char *implementationId; /* OPTIONAL */
322 char *implementationName; /* OPTIONAL */
323 char *implementationVersion; /* OPTIONAL */
324 Z_External *userInformationField; /* OPTIONAL */
326 Z_OtherInformation *otherInfo; /* OPTIONAL */
330 typedef struct Z_InitResponse
332 Z_ReferenceId *referenceId; /* OPTIONAL */
333 Odr_bitmask *protocolVersion;
334 Odr_bitmask *options;
335 int *preferredMessageSize;
336 int *maximumRecordSize;
338 char *implementationId; /* OPTIONAL */
339 char *implementationName; /* OPTIONAL */
340 char *implementationVersion; /* OPTIONAL */
341 Z_External *userInformationField; /* OPTIONAL */
343 Z_OtherInformation *otherInfo; /* OPTIONAL */
347 typedef struct Z_NSRAuthentication
352 } Z_NSRAuthentication;
354 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
356 int z_StrAuthentication(ODR o, char **p, int opt);
358 /* ------------------ SEARCH SERVICE ----------------*/
360 typedef struct Z_DatabaseSpecificUnit
363 char *elementSetName;
364 } Z_DatabaseSpecificUnit;
366 typedef struct Z_DatabaseSpecific
369 Z_DatabaseSpecificUnit **elements;
370 } Z_DatabaseSpecific;
372 typedef struct Z_ElementSetNames
375 #define Z_ElementSetNames_generic 0
376 #define Z_ElementSetNames_databaseSpecific 1
380 Z_DatabaseSpecific *databaseSpecific;
384 /* ---------------------- RPN QUERY --------------------------- */
386 typedef struct Z_ComplexAttribute
389 Z_StringOrNumeric **list;
390 int num_semanticAction;
391 int **semanticAction; /* OPTIONAL */
392 } Z_ComplexAttribute;
394 typedef struct Z_AttributeElement
397 Odr_oid *attributeSet; /* OPTIONAL - v3 only */
402 #define Z_AttributeValue_numeric 0
403 #define Z_AttributeValue_complex 1
407 Z_ComplexAttribute *complex;
412 } Z_AttributeElement;
414 typedef struct Z_Term
417 #define Z_Term_general 0
418 #define Z_Term_numeric 1
419 #define Z_Term_characterString 2
421 #define Z_Term_dateTime 4
422 #define Z_Term_external 5
423 #define Z_Term_integerAndUnit 6
424 #define Z_Term_null 7
427 Odr_oct *general; /* this is required for v2 */
429 char *characterString;
432 Z_External *external;
433 /* Z_IntUnit *integerAndUnit; */
438 typedef struct Z_AttributesPlusTerm
441 Z_AttributeElement **attributeList;
443 } Z_AttributesPlusTerm;
445 typedef struct Z_ResultSetPlusAttributes
449 Z_AttributeElement **attributeList;
450 } Z_ResultSetPlusAttributes;
452 typedef struct Z_ProximityOperator
454 bool_t *exclusion; /* OPTIONAL */
458 #define Z_Prox_lessThan 1
459 #define Z_Prox_lessThanOrEqual 2
460 #define Z_Prox_equal 3
461 #define Z_Prox_greaterThanOrEqual 4
462 #define Z_Prox_greaterThan 5
463 #define Z_Prox_notEqual 6
465 #define Z_ProxCode_known 0
466 #define Z_ProxCode_private 1
467 int *proximityUnitCode;
468 #define Z_ProxUnit_character 1
469 #define Z_ProxUnit_word 2
470 #define Z_ProxUnit_sentence 3
471 #define Z_ProxUnit_paragraph 4
472 #define Z_ProxUnit_section 5
473 #define Z_ProxUnit_chapter 6
474 #define Z_ProxUnit_document 7
475 #define Z_ProxUnit_element 8
476 #define Z_ProxUnit_subelement 9
477 #define Z_ProxUnit_elementType 10
478 #define Z_ProxUnit_byte 11 /* v3 only */
479 } Z_ProximityOperator;
481 typedef struct Z_Operator
484 #define Z_Operator_and 0
485 #define Z_Operator_or 1
486 #define Z_Operator_and_not 2
487 #define Z_Operator_prox 3
490 Odr_null *and; /* these guys are nulls. */
493 Z_ProximityOperator *prox;
497 typedef struct Z_Operand
500 #define Z_Operand_APT 0
501 #define Z_Operand_resultSetId 1
502 #define Z_Operand_resultAttr /* v3 only */ 2
505 Z_AttributesPlusTerm *attributesPlusTerm;
506 Z_ResultSetId *resultSetId;
507 Z_ResultSetPlusAttributes *resultAttr;
511 typedef struct Z_Complex
513 struct Z_RPNStructure *s1;
514 struct Z_RPNStructure *s2;
515 Z_Operator *roperator;
518 typedef struct Z_RPNStructure
521 #define Z_RPNStructure_simple 0
522 #define Z_RPNStructure_complex 1
530 typedef struct Z_RPNQuery
532 Odr_oid *attributeSetId;
533 Z_RPNStructure *RPNStructure;
536 /* -------------------------- SEARCHREQUEST -------------------------- */
538 typedef struct Z_Query
541 #define Z_Query_type_1 1
542 #define Z_Query_type_2 2
543 #define Z_Query_type_101 3
548 Z_RPNQuery *type_101;
552 typedef struct Z_SearchRequest
554 Z_ReferenceId *referenceId; /* OPTIONAL */
555 int *smallSetUpperBound;
556 int *largeSetLowerBound;
557 int *mediumSetPresentNumber;
558 bool_t *replaceIndicator;
560 int num_databaseNames;
561 char **databaseNames;
562 Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */
563 Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */
564 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
567 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */
568 Z_OtherInformation *otherInfo; /* OPTIONAL */
572 /* ------------------------ RECORD -------------------------- */
574 typedef Z_External Z_DatabaseRecord;
578 typedef struct Z_DefaultDiagFormat
580 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
582 /* until the whole character set issue becomes more definite,
583 * you can probably ignore this on input. */
585 #define Z_DiagForm_v2AddInfo 0
586 #define Z_DiagForm_v3AddInfo 1
588 } Z_DefaultDiagFormat;
590 typedef struct Z_DiagRec
593 #define Z_DiagRec_defaultFormat 0
594 #define Z_DiagRec_externallyDefined 1
597 Z_DefaultDiagFormat *defaultFormat;
598 Z_External *externallyDefined;
604 typedef struct Z_DiagRec
606 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
613 typedef struct Z_DiagRecs
616 Z_DiagRec **diagRecs;
619 typedef struct Z_NamePlusRecord
621 char *databaseName; /* OPTIONAL */
623 #define Z_NamePlusRecord_databaseRecord 0
624 #define Z_NamePlusRecord_surrogateDiagnostic 1
627 Z_DatabaseRecord *databaseRecord;
628 Z_DiagRec *surrogateDiagnostic;
632 typedef struct Z_NamePlusRecordList
635 Z_NamePlusRecord **records;
636 } Z_NamePlusRecordList;
638 typedef struct Z_Records
641 #define Z_Records_DBOSD 0
642 #define Z_Records_NSD 1
643 #define Z_Records_multipleNSD 2
646 Z_NamePlusRecordList *databaseOrSurDiagnostics;
647 Z_DiagRec *nonSurrogateDiagnostic;
648 Z_DiagRecs *multipleNonSurDiagnostics;
652 /* ------------------------ SEARCHRESPONSE ------------------ */
654 typedef struct Z_SearchResponse
656 Z_ReferenceId *referenceId; /* OPTIONAL */
658 int *numberOfRecordsReturned;
659 int *nextResultSetPosition;
660 bool_t *searchStatus;
661 int *resultSetStatus; /* OPTIONAL */
662 #define Z_RES_SUBSET 1
663 #define Z_RES_INTERIM 2
665 int *presentStatus; /* OPTIONAL */
666 #define Z_PRES_SUCCESS 0
667 #define Z_PRES_PARTIAL_1 1
668 #define Z_PRES_PARTIAL_2 2
669 #define Z_PRES_PARTIAL_3 3
670 #define Z_PRES_PARTIAL_4 4
671 #define Z_PRES_FAILURE 5
672 Z_Records *records; /* OPTIONAL */
674 Z_OtherInformation *additionalSearchInfo;
675 Z_OtherInformation *otherInfo;
679 /* ------------------------- PRESENT SERVICE -----------------*/
681 typedef struct Z_ElementSpec
684 #define Z_ElementSpec_elementSetName 0
685 #define Z_ElementSpec_externalSpec 1
688 char *elementSetName;
689 Z_External *externalSpec;
693 typedef struct Z_Specification
695 Odr_oid *schema; /* OPTIONAL */
696 Z_ElementSpec *elementSpec; /* OPTIONAL */
699 typedef struct Z_DbSpecific
702 Z_Specification *spec;
705 typedef struct Z_CompSpec
707 bool_t *selectAlternativeSyntax;
708 Z_Specification *generic; /* OPTIONAL */
710 Z_DbSpecific **dbSpecific; /* OPTIONAL */
711 int num_recordSyntax;
712 Odr_oid **recordSyntax; /* OPTIONAL */
715 typedef struct Z_RecordComposition
718 #define Z_RecordComp_simple 0
719 #define Z_RecordComp_complex 1
722 Z_ElementSetNames *simple;
725 } Z_RecordComposition;
727 typedef struct Z_Range
729 int *startingPosition;
730 int *numberOfRecords;
733 typedef struct Z_PresentRequest
735 Z_ReferenceId *referenceId; /* OPTIONAL */
736 Z_ResultSetId *resultSetId;
737 int *resultSetStartPoint;
738 int *numberOfRecordsRequested;
741 Z_Range **additionalRanges; /* OPTIONAL */
742 Z_RecordComposition *recordComposition; /* OPTIONAL */
744 Z_ElementSetNames *elementSetNames; /* OPTIONAL */
746 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
748 int *maxSegmentCount; /* OPTIONAL */
749 int *maxRecordSize; /* OPTIONAL */
750 int *maxSegmentSize; /* OPTIONAL */
751 Z_OtherInformation *otherInfo; /* OPTIONAL */
755 typedef struct Z_PresentResponse
757 Z_ReferenceId *referenceId; /* OPTIONAL */
758 int *numberOfRecordsReturned;
759 int *nextResultSetPosition;
763 Z_OtherInformation *otherInfo; /* OPTIONAL */
767 /* ------------------ RESOURCE CONTROL ----------------*/
769 typedef struct Z_TriggerResourceControlRequest
771 Z_ReferenceId *referenceId; /* OPTIONAL */
772 int *requestedAction;
773 #define Z_TriggerResourceCtrl_resourceReport 1
774 #define Z_TriggerResourceCtrl_resourceControl 2
775 #define Z_TriggerResourceCtrl_cancel 3
776 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
777 bool_t *resultSetWanted; /* OPTIONAL */
779 Z_OtherInformation *otherInfo;
781 } Z_TriggerResourceControlRequest;
783 typedef struct Z_ResourceControlRequest
785 Z_ReferenceId *referenceId; /* OPTIONAL */
786 bool_t *suspendedFlag; /* OPTIONAL */
787 Z_External *resourceReport; /* OPTIONAL */
788 int *partialResultsAvailable; /* OPTIONAL */
789 #define Z_ResourceControlRequest_subset 1
790 #define Z_ResourceControlRequest_interim 2
791 #define Z_ResourceControlRequest_none 3
792 bool_t *responseRequired;
793 bool_t *triggeredRequestFlag; /* OPTIONAL */
795 Z_OtherInformation *otherInfo;
797 } Z_ResourceControlRequest;
799 typedef struct Z_ResourceControlResponse
801 Z_ReferenceId *referenceId; /* OPTIONAL */
802 bool_t *continueFlag;
803 bool_t *resultSetWanted; /* OPTIONAL */
805 Z_OtherInformation *otherInfo;
807 } Z_ResourceControlResponse;
810 /* ------------------ ACCESS CTRL SERVICE ----------------*/
812 typedef struct Z_AccessControlRequest
814 Z_ReferenceId *referenceId; /* OPTIONAL */
816 #define Z_AccessRequest_simpleForm 0
817 #define Z_AccessRequest_externallyDefined 1
821 Z_External *externallyDefined;
824 Z_OtherInformation *otherInfo; /* OPTIONAL */
826 } Z_AccessControlRequest;
828 typedef struct Z_AccessControlResponse
830 Z_ReferenceId *referenceId; /* OPTIONAL */
832 #define Z_AccessResponse_simpleForm 0
833 #define Z_AccessResponse_externallyDefined 1
837 Z_External *externallyDefined;
839 Z_DiagRec *diagnostic; /* OPTIONAL */
841 Z_OtherInformation *otherInfo; /* OPTIONAL */
843 } Z_AccessControlResponse;
845 /* ------------------------ SCAN SERVICE -------------------- */
847 typedef struct Z_AttributeList
850 Z_AttributeElement **attributes;
853 typedef struct Z_AlternativeTerm
856 Z_AttributesPlusTerm **terms;
861 typedef struct Z_ByDatabase
864 int *num; /* OPTIONAL */
865 Z_OtherInformation *otherDbInfo; /* OPTIONAL */
868 typedef struct Z_ByDatabaseList
871 Z_ByDatabase **elements;
874 typedef struct Z_ScanOccurrences
877 #define Z_ScanOccurrences_global 0
878 #define Z_ScanOccurrences_byDatabase 1
882 Z_ByDatabaseList *byDatabase;
887 typedef struct Z_OccurrenceByAttributesElem
889 Z_AttributeList *attributes;
890 Z_ScanOccurrences *occurrences; /* OPTIONAL */
891 Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
892 } Z_OccurrenceByAttributesElem;
894 typedef struct Z_OccurrenceByAttributes
897 Z_OccurrenceByAttributesElem **elements;
898 } Z_OccurrenceByAttributes;
903 * Old, incomplete definition of OccurrenceByAttributes.
906 typedef struct Z_OccurrenceByAttributes
908 Z_AttributeList *attributes;
911 #define Z_OByAtt_global 0
912 #define Z_ObyAtt_byDatabase 1
918 /* Z_ByDatabase *byDatabase; */
921 } Z_OccurrenceByAttributes;
925 typedef struct Z_TermInfo
928 char *displayTerm; /* OPTIONAL */
929 Z_AttributeList *suggestedAttributes; /* OPTIONAL */
930 Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
931 int *globalOccurrences; /* OPTIONAL */
932 Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
933 Z_OtherInformation *otherTermInfo; /* OPTIONAL */
936 typedef struct Z_Entry
939 #define Z_Entry_termInfo 0
940 #define Z_Entry_surrogateDiagnostic 1
943 Z_TermInfo *termInfo;
944 Z_DiagRec *surrogateDiagnostic;
948 typedef struct Z_Entries
954 typedef struct Z_ListEntries
957 #define Z_ListEntries_entries 0
958 #define Z_ListEntries_nonSurrogateDiagnostics 1
962 Z_DiagRecs *nonSurrogateDiagnostics;
966 typedef struct Z_ScanRequest
968 Z_ReferenceId *referenceId; /* OPTIONAL */
969 int num_databaseNames;
970 char **databaseNames;
971 Odr_oid *attributeSet; /* OPTIONAL */
972 Z_AttributesPlusTerm *termListAndStartPoint;
973 int *stepSize; /* OPTIONAL */
974 int *numberOfTermsRequested;
975 int *preferredPositionInResponse; /* OPTIONAL */
977 Z_OtherInformation *otherInfo;
981 typedef struct Z_ScanResponse
983 Z_ReferenceId *referenceId; /* OPTIONAL */
984 int *stepSize; /* OPTIONAL */
986 #define Z_Scan_success 0
987 #define Z_Scan_partial_1 1
988 #define Z_Scan_partial_2 2
989 #define Z_Scan_partial_3 3
990 #define Z_Scan_partial_4 4
991 #define Z_Scan_partial_5 5
992 #define Z_Scan_failure 6
993 int *numberOfEntriesReturned;
994 int *positionOfTerm; /* OPTIONAL */
995 Z_ListEntries *entries; /* OPTIONAL */
996 Odr_oid *attributeSet; /* OPTIONAL */
998 Z_OtherInformation *otherInfo;
1003 /* ------------------------ DELETE -------------------------- */
1005 #define Z_DeleteStatus_success 0
1006 #define Z_DeleteStatus_resultSetDidNotExist 1
1007 #define Z_DeleteStatus_previouslyDeletedByTarget 2
1008 #define Z_DeleteStatus_systemProblemAtTarget 3
1009 #define Z_DeleteStatus_accessNotAllowed 4
1010 #define Z_DeleteStatus_resourceControlAtOrigin 5
1011 #define Z_DeleteStatus_resourceControlAtTarget 6
1012 #define Z_DeleteStatus_bulkDeleteNotSupported 7
1013 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
1014 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
1015 #define Z_DeleteStatus_resultSetInUse 10
1017 typedef struct Z_ListStatus
1023 typedef struct Z_DeleteResultSetRequest
1025 Z_ReferenceId *referenceId; /* OPTIONAL */
1026 int *deleteFunction;
1027 #define Z_DeleteRequest_list 0
1028 #define Z_DeleteRequest_all 1
1030 Z_ResultSetId **resultSetList; /* OPTIONAL */
1032 Z_OtherInformation *otherInfo;
1034 } Z_DeleteResultSetRequest;
1036 typedef struct Z_DeleteResultSetResponse
1038 Z_ReferenceId *referenceId; /* OPTIONAL */
1039 int *deleteOperationStatus;
1041 Z_ListStatus **deleteListStatuses; /* OPTIONAL */
1042 int *numberNotDeleted; /* OPTIONAL */
1043 int num_bulkStatuses;
1044 Z_ListStatus **bulkStatuses; /* OPTIONAL */
1045 char *deleteMessage; /* OPTIONAL */
1047 Z_OtherInformation *otherInfo;
1049 } Z_DeleteResultSetResponse;
1051 /* ------------------------ CLOSE SERVICE ------------------- */
1053 typedef struct Z_Close
1055 Z_ReferenceId *referenceId; /* OPTIONAL */
1057 #define Z_Close_finished 0
1058 #define Z_Close_shutdown 1
1059 #define Z_Close_systemProblem 2
1060 #define Z_Close_costLimit 3
1061 #define Z_Close_resources 4
1062 #define Z_Close_securityViolation 5
1063 #define Z_Close_protocolError 6
1064 #define Z_Close_lackOfActivity 7
1065 #define Z_Close_peerAbort 8
1066 #define Z_Close_unspecified 9
1067 char *diagnosticInformation; /* OPTIONAL */
1068 Odr_oid *resourceReportFormat; /* OPTIONAL */
1069 Z_External *resourceReport; /* OPTIONAL */
1071 Z_OtherInformation *otherInfo; /* OPTIONAL */
1075 /* ------------------------ SEGMENTATION -------------------- */
1077 typedef struct Z_Segment
1079 Z_ReferenceId *referenceId; /* OPTIONAL */
1080 int *numberOfRecordsReturned;
1081 int num_segmentRecords;
1082 Z_NamePlusRecord **segmentRecords;
1083 Z_OtherInformation *otherInfo; /* OPTIONAL */
1086 /* ----------------------- Extended Services ---------------- */
1088 typedef struct Z_Permissions
1091 int num_allowableFunctions;
1092 int **allowableFunctions;
1093 #define Z_Permissions_delete 1
1094 #define Z_Permissions_modifyContents 2
1095 #define Z_Permissions_modifyPermissions 3
1096 #define Z_Permissions_present 4
1097 #define Z_Permissions_invoke 5
1100 typedef struct Z_ExtendedServicesRequest
1102 Z_ReferenceId *referenceId; /* OPTIONAL */
1104 #define Z_ExtendedServicesRequest_create 1
1105 #define Z_ExtendedServicesRequest_delete 2
1106 #define Z_ExtendedServicesRequest_modify 3
1107 Odr_oid *packageType;
1108 char *packageName; /* OPTIONAL */
1109 char *userId; /* OPTIONAL */
1110 Z_IntUnit *retentionTime; /* OPTIONAL */
1111 Z_Permissions *permissions; /* OPTIONAL */
1112 char *description; /* OPTIONAL */
1113 Z_External *taskSpecificParameters; /* OPTIONAL */
1115 #define Z_ExtendedServicesRequest_wait 1
1116 #define Z_ExtendedServicesRequest_waitIfPossible 2
1117 #define Z_ExtendedServicesRequest_dontWait 3
1118 #define Z_ExtendedServicesRequest_dontReturnPackage 4
1119 char *elements; /* OPTIONAL */
1120 Z_OtherInformation *otherInfo; /* OPTIONAL */
1121 } Z_ExtendedServicesRequest;
1123 typedef struct Z_ExtendedServicesResponse
1125 Z_ReferenceId *referenceId; /* OPTIONAL */
1126 int *operationStatus;
1127 #define Z_ExtendedServicesResponse_done 1
1128 #define Z_ExtendedServicesResponse_accepted 2
1129 #define Z_ExtendedServicesResponse_failure 3
1130 int num_diagnostics;
1131 Z_DiagRec **diagnostics; /* OPTIONAL */
1132 Z_External *taskPackage; /* OPTIONAL */
1133 Z_OtherInformation *otherInfo; /* OPTIONAL */
1134 } Z_ExtendedServicesResponse;
1136 /* ------------------------ Sort --------------------------- */
1138 typedef struct Z_SortAttributes
1141 Z_AttributeList *list;
1144 typedef struct Z_SortKey
1147 #define Z_SortKey_sortField 0
1148 #define Z_SortKey_elementSpec 1
1149 #define Z_SortKey_sortAttributes 2
1153 Z_Specification *elementSpec;
1154 Z_SortAttributes *sortAttributes;
1158 typedef struct Z_SortDbSpecific
1164 typedef struct Z_SortDbSpecificList
1167 Z_SortDbSpecific **dbSpecific;
1168 } Z_SortDbSpecificList;
1170 typedef struct Z_SortElement
1173 #define Z_SortElement_generic 0
1174 #define Z_SortElement_databaseSpecific 1
1178 Z_SortDbSpecificList *databaseSpecific;
1182 typedef struct Z_SortMissingValueAction
1185 #define Z_SortMissingValAct_abort 0
1186 #define Z_SortMissingValAct_null 1
1187 #define Z_SortMissingValAct_valData 2
1194 } Z_SortMissingValueAction;
1196 typedef struct Z_SortKeySpec
1198 Z_SortElement *sortElement;
1200 #define Z_SortRelation_ascending 0
1201 #define Z_SortRelation_descending 1
1202 #define Z_SortRelation_ascendingByFreq 3
1203 #define Z_SortRelation_descendingByFreq 4
1204 int *caseSensitivity;
1205 #define Z_SortCase_caseSensitive 0
1206 #define Z_SortCase_caseInsensitive 1
1207 Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
1210 typedef struct Z_SortResponse
1212 Z_ReferenceId *referenceId; /* OPTIONAL */
1214 #define Z_SortStatus_success 0
1215 #define Z_SortStatus_partial_1 1
1216 #define Z_SortStatus_failure 2
1217 int *resultSetStatus; /* OPTIONAL */
1218 #define Z_SortResultSetStatus_empty 1
1219 #define Z_SortResultSetStatus_interim 2
1220 #define Z_SortResultSetStatus_unchanged 3
1221 #define Z_SortResultSetStatus_none 4
1222 Z_DiagRecs *diagnostics; /* OPTIONAL */
1223 Z_OtherInformation *otherInfo; /* OPTIONAL */
1226 typedef struct Z_SortKeySpecList
1229 Z_SortKeySpec **specs;
1230 } Z_SortKeySpecList;
1232 typedef struct Z_SortRequest
1234 Z_ReferenceId *referenceId; /* OPTIONAL */
1235 Z_StringList *inputResultSetNames;
1236 char *sortedResultSetName;
1237 Z_SortKeySpecList *sortSequence;
1238 Z_OtherInformation *otherInfo; /* OPTIONAL */
1241 /* ----------------------- Resource Report ------------------ */
1243 typedef struct Z_ResourceReportRequest
1245 Z_ReferenceId *referenceId; /* OPTIONAL */
1246 Z_ReferenceId *opId; /* OPTIONAL */
1247 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
1248 Z_OtherInformation *otherInfo; /* OPTIONAL */
1249 } Z_ResourceReportRequest;
1251 typedef struct Z_ResourceReportResponse
1253 Z_ReferenceId *referenceId; /* OPTIONAL */
1254 int *resourceReportStatus;
1255 #define Z_ResourceReportStatus_success 0
1256 #define Z_ResourceReportStatus_partial 1
1257 #define Z_ResourceReportStatus_failure_1 2
1258 #define Z_ResourceReportStatus_failure_2 3
1259 #define Z_ResourceReportStatus_failure_3 4
1260 #define Z_ResourceReportStatus_failure_4 5
1261 #define Z_ResourceReportStatus_failure_5 6
1262 #define Z_ResourceReportStatus_failure_6 7
1263 Z_External *resourceReport; /* OPTIONAL */
1264 Z_OtherInformation *otherInfo; /* OPTIONAL */
1265 } Z_ResourceReportResponse;
1267 /* ------------------------ APDU ---------------------------- */
1269 typedef struct Z_APDU
1272 #define Z_APDU_initRequest 0
1273 #define Z_APDU_initResponse 1
1274 #define Z_APDU_searchRequest 2
1275 #define Z_APDU_searchResponse 3
1276 #define Z_APDU_presentRequest 4
1277 #define Z_APDU_presentResponse 5
1278 #define Z_APDU_deleteResultSetRequest 6
1279 #define Z_APDU_deleteResultSetResponse 7
1280 #define Z_APDU_resourceControlRequest 8
1281 #define Z_APDU_resourceControlResponse 9
1282 #define Z_APDU_triggerResourceControlRequest 10
1283 #define Z_APDU_scanRequest 11
1284 #define Z_APDU_scanResponse 12
1285 #define Z_APDU_segmentRequest 13
1286 #define Z_APDU_extendedServicesRequest 14
1287 #define Z_APDU_extendedServicesResponse 15
1288 #define Z_APDU_close 16
1289 #define Z_APDU_accessControlRequest 17
1290 #define Z_APDU_accessControlResponse 18
1291 #define Z_APDU_sortRequest 20
1292 #define Z_APDU_sortResponse 21
1293 #define Z_APDU_resourceReportRequest 22
1294 #define Z_APDU_resourceReportResponse 23
1297 Z_InitRequest *initRequest;
1298 Z_InitResponse *initResponse;
1299 Z_SearchRequest *searchRequest;
1300 Z_SearchResponse *searchResponse;
1301 Z_PresentRequest *presentRequest;
1302 Z_PresentResponse *presentResponse;
1303 Z_DeleteResultSetRequest *deleteResultSetRequest;
1304 Z_DeleteResultSetResponse *deleteResultSetResponse;
1305 Z_AccessControlRequest *accessControlRequest;
1306 Z_AccessControlResponse *accessControlResponse;
1307 Z_ResourceControlRequest *resourceControlRequest;
1308 Z_ResourceControlResponse *resourceControlResponse;
1309 Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1310 Z_ResourceReportRequest *resourceReportRequest;
1311 Z_ResourceReportResponse *resourceReportResponse;
1312 Z_ScanRequest *scanRequest;
1313 Z_ScanResponse *scanResponse;
1314 Z_SortRequest *sortRequest;
1315 Z_SortResponse *sortResponse;
1316 Z_Segment *segmentRequest;
1317 Z_ExtendedServicesRequest *extendedServicesRequest;
1318 Z_ExtendedServicesResponse *extendedServicesResponse;
1323 int z_APDU(ODR o, Z_APDU **p, int opt);
1324 int z_SUTRS(ODR o, Odr_oct **p, int opt);
1326 Z_InitRequest *zget_InitRequest(ODR o);
1327 Z_InitResponse *zget_InitResponse(ODR o);
1328 Z_SearchRequest *zget_SearchRequest(ODR o);
1329 Z_SearchResponse *zget_SearchResponse(ODR o);
1330 Z_PresentRequest *zget_PresentRequest(ODR o);
1331 Z_PresentResponse *zget_PresentResponse(ODR o);
1332 Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1333 Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1334 Z_ScanRequest *zget_ScanRequest(ODR o);
1335 Z_ScanResponse *zget_ScanResponse(ODR o);
1336 Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1337 Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1338 Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1339 Z_Close *zget_Close(ODR o);
1340 int z_StringList(ODR o, Z_StringList **p, int opt);
1341 int z_InternationalString(ODR o, char **p, int opt);
1342 int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt);
1343 int z_ElementSetName(ODR o, char **p, int opt);
1344 int z_IntUnit(ODR o, Z_IntUnit **p, int opt);
1345 int z_Unit(ODR o, Z_Unit **p, int opt);
1346 int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt);
1347 int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt);
1348 int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt);
1349 int z_Term(ODR o, Z_Term **p, int opt);
1350 int z_Specification(ODR o, Z_Specification **p, int opt);
1351 int z_Permissions(ODR o, Z_Permissions **p, int opt);
1352 int z_DiagRec(ODR o, Z_DiagRec **p, int opt);
1353 int z_AttributeList(ODR o, Z_AttributeList **p, int opt);
1354 int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt);
1355 Z_APDU *zget_APDU(ODR o, int which);
1356 int z_Query(ODR o, Z_Query **p, int opt);
1358 #include <prt-rsc.h>
1359 #include <prt-acc.h>
1360 #include <prt-exp.h>
1361 #include <prt-grs.h>
1362 #include <prt-arc.h>
1363 #include <prt-exd.h>
1364 #include <prt-dia.h>
1365 #include <prt-esp.h>
1366 #include <prt-add.h>
1368 #include <prt-ext.h>