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.40 1997-09-01 08:49:50 adam
28 * New windows NT/95 port using MSV5.0. To export DLL functions the
29 * YAZ_EXPORT modifier was added. Defined in yconfig.h.
31 * Revision 1.39 1997/05/14 06:53:44 adam
34 * Revision 1.38 1997/04/30 08:52:09 quinn
37 * Revision 1.37 1996/10/09 15:54:58 quinn
38 * Added SearchInfoReport
40 * Revision 1.36 1996/10/07 15:29:20 quinn
43 * Revision 1.35 1996/06/10 08:57:38 quinn
44 * Added OPAC, ResourceReport
46 * Revision 1.34 1996/06/10 08:55:36 quinn
49 * Revision 1.33 1996/02/23 10:00:51 quinn
52 * Revision 1.32 1996/02/20 12:52:39 quinn
55 * Revision 1.31 1996/01/22 09:46:45 quinn
56 * Added Sort PDU. Moved StringList to main protocol file.
58 * Revision 1.30 1996/01/10 15:21:32 quinn
59 * Added links to access control PDUs
61 * Revision 1.29 1996/01/02 11:46:49 quinn
62 * Changed 'operator' to 'roperator' to avoid C++ conflict.
65 * Revision 1.28 1996/01/02 08:57:32 quinn
66 * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
68 * Revision 1.27 1995/10/12 10:34:46 quinn
71 * Revision 1.26 1995/09/29 17:12:08 quinn
74 * Revision 1.25 1995/09/27 15:02:49 quinn
75 * Modified function heads & prototypes.
77 * Revision 1.24 1995/08/29 11:17:43 quinn
78 * *** empty log message ***
80 * Revision 1.23 1995/08/21 09:10:36 quinn
81 * Smallish fixes to suppport new formats.
83 * Revision 1.22 1995/08/17 12:45:14 quinn
84 * Fixed minor problems with GRS-1. Added support in c&s.
86 * Revision 1.21 1995/08/15 12:00:11 quinn
89 * Revision 1.20 1995/08/10 08:54:35 quinn
92 * Revision 1.19 1995/06/19 12:38:28 quinn
93 * Reorganized include-files. Added small features.
95 * Revision 1.18 1995/06/16 13:16:05 quinn
96 * Fixed Defaultdiagformat.
98 * Revision 1.17 1995/06/15 15:42:05 quinn
101 * Revision 1.16 1995/06/15 07:45:06 quinn
104 * Revision 1.15 1995/06/14 15:26:43 quinn
105 * *** empty log message ***
107 * Revision 1.14 1995/06/07 14:42:34 quinn
110 * Revision 1.13 1995/06/07 14:36:47 quinn
113 * Revision 1.12 1995/06/05 10:53:13 quinn
116 * Revision 1.11 1995/06/02 09:49:47 quinn
119 * Revision 1.10 1995/05/29 08:11:34 quinn
120 * Moved oid from odr/asn to util.
122 * Revision 1.9 1995/05/22 11:31:25 quinn
125 * Revision 1.8 1995/05/17 08:41:35 quinn
126 * Added delete to proto & other little things.
127 * Relaying auth info to backend.
129 * Revision 1.7 1995/05/16 08:50:37 quinn
130 * License, documentation, and memory fixes
132 * Revision 1.6 1995/05/15 11:55:55 quinn
133 * Work on asynchronous activity.
135 * Revision 1.5 1995/04/17 11:28:18 quinn
138 * Revision 1.4 1995/04/10 10:22:47 quinn
141 * Revision 1.3 1995/03/30 12:18:09 quinn
144 * Revision 1.2 1995/03/30 10:26:48 quinn
145 * Added Term structure
147 * Revision 1.1 1995/03/30 09:39:42 quinn
148 * Moved .h files to include directory
150 * Revision 1.11 1995/03/30 09:08:44 quinn
151 * Added Resource control protocol
153 * Revision 1.10 1995/03/29 15:39:39 quinn
154 * Adding some resource control elements, and a null-check to getentbyoid
156 * Revision 1.9 1995/03/29 08:06:18 quinn
157 * Added a few v3 elements
159 * Revision 1.8 1995/03/22 10:12:49 quinn
160 * Added Z_PRES constants.
162 * Revision 1.7 1995/03/20 09:45:12 quinn
165 * Revision 1.5 1995/03/07 16:29:34 quinn
166 * Added authentication stuff.
168 * Revision 1.4 1995/03/07 10:13:00 quinn
169 * Added prototype for z_APDU()
171 * Revision 1.3 1995/02/14 11:54:23 quinn
174 * Revision 1.2 1995/02/09 15:51:40 quinn
177 * Revision 1.1 1995/02/06 16:44:48 quinn
178 * First hack at Z/SR protocol
189 #include <yaz-version.h>
196 * Because we didn't have time to put all of the extra v3 elements in here
197 * before the first applications were written, we have to place them
198 * in #ifdefs in places where they would break existing code. If you are
199 * developing new stuff, we urge you to leave them in, even if you don't
200 * intend to use any v3 features. When we are comfortable that the old
201 * apps have been updated, we'll remove the #ifdefs.
206 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
209 typedef struct Z_External Z_External;
211 typedef Odr_oct Z_ReferenceId;
212 typedef char Z_DatabaseName;
213 typedef char Z_ResultSetId;
214 typedef Odr_oct Z_ResultsetId;
216 typedef struct Z_InfoCategory
218 Odr_oid *categoryTypeId; /* OPTIONAL */
222 typedef struct Z_OtherInformationUnit
224 Z_InfoCategory *category; /* OPTIONAL */
226 #define Z_OtherInfo_characterInfo 0
227 #define Z_OtherInfo_binaryInfo 1
228 #define Z_OtherInfo_externallyDefinedInfo 2
229 #define Z_OtherInfo_oid 3
234 Z_External *externallyDefinedInfo;
237 } Z_OtherInformationUnit;
239 typedef struct Z_OtherInformation
242 Z_OtherInformationUnit **list;
243 } Z_OtherInformation;
245 typedef struct Z_StringOrNumeric
248 #define Z_StringOrNumeric_string 0
249 #define Z_StringOrNumeric_numeric 1
257 typedef struct Z_Unit
259 char *unitSystem; /* OPTIONAL */
260 Z_StringOrNumeric *unitType; /* OPTIONAL */
261 Z_StringOrNumeric *unit; /* OPTIONAL */
262 int *scaleFactor; /* OPTIONAL */
265 typedef struct Z_IntUnit
271 typedef Odr_oct Z_SUTRS;
273 typedef struct Z_StringList
279 /* ----------------- INIT SERVICE ----------------*/
283 char *groupId; /* OPTIONAL */
284 char *userId; /* OPTIONAL */
285 char *password; /* OPTIONAL */
288 typedef struct Z_IdAuthentication
291 #define Z_IdAuthentication_open 0
292 #define Z_IdAuthentication_idPass 1
293 #define Z_IdAuthentication_anonymous 2
294 #define Z_IdAuthentication_other 3
302 } Z_IdAuthentication;
304 #define Z_ProtocolVersion_1 0
305 #define Z_ProtocolVersion_2 1
306 #define Z_ProtocolVersion_3 2
308 #define Z_Options_search 0
309 #define Z_Options_present 1
310 #define Z_Options_delSet 2
311 #define Z_Options_resourceReport 3
312 #define Z_Options_triggerResourceCtrl 4
313 #define Z_Options_resourceCtrl 5
314 #define Z_Options_accessCtrl 6
315 #define Z_Options_scan 7
316 #define Z_Options_sort 8
317 #define Z_Options_reserved 9
318 #define Z_Options_extendedServices 10
319 #define Z_Options_level_1Segmentation 11
320 #define Z_Options_level_2Segmentation 12
321 #define Z_Options_concurrentOperations 13
322 #define Z_Options_namedResultSets 14
324 typedef struct Z_InitRequest
326 Z_ReferenceId *referenceId; /* OPTIONAL */
327 Odr_bitmask *protocolVersion;
328 Odr_bitmask *options;
329 int *preferredMessageSize;
330 int *maximumRecordSize;
331 Z_IdAuthentication* idAuthentication; /* OPTIONAL */
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_InitResponse
343 Z_ReferenceId *referenceId; /* OPTIONAL */
344 Odr_bitmask *protocolVersion;
345 Odr_bitmask *options;
346 int *preferredMessageSize;
347 int *maximumRecordSize;
349 char *implementationId; /* OPTIONAL */
350 char *implementationName; /* OPTIONAL */
351 char *implementationVersion; /* OPTIONAL */
352 Z_External *userInformationField; /* OPTIONAL */
354 Z_OtherInformation *otherInfo; /* OPTIONAL */
358 typedef struct Z_NSRAuthentication
363 } Z_NSRAuthentication;
365 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
367 int z_StrAuthentication(ODR o, char **p, int opt);
369 /* ------------------ SEARCH SERVICE ----------------*/
371 typedef struct Z_DatabaseSpecificUnit
374 char *elementSetName;
375 } Z_DatabaseSpecificUnit;
377 typedef struct Z_DatabaseSpecific
380 Z_DatabaseSpecificUnit **elements;
381 } Z_DatabaseSpecific;
383 typedef struct Z_ElementSetNames
386 #define Z_ElementSetNames_generic 0
387 #define Z_ElementSetNames_databaseSpecific 1
391 Z_DatabaseSpecific *databaseSpecific;
395 /* ---------------------- RPN QUERY --------------------------- */
397 typedef struct Z_ComplexAttribute
400 Z_StringOrNumeric **list;
401 int num_semanticAction;
402 int **semanticAction; /* OPTIONAL */
403 } Z_ComplexAttribute;
405 typedef struct Z_AttributeElement
408 Odr_oid *attributeSet; /* OPTIONAL - v3 only */
413 #define Z_AttributeValue_numeric 0
414 #define Z_AttributeValue_complex 1
418 Z_ComplexAttribute *complex;
423 } Z_AttributeElement;
425 typedef struct Z_Term
428 #define Z_Term_general 0
429 #define Z_Term_numeric 1
430 #define Z_Term_characterString 2
432 #define Z_Term_dateTime 4
433 #define Z_Term_external 5
434 #define Z_Term_integerAndUnit 6
435 #define Z_Term_null 7
438 Odr_oct *general; /* this is required for v2 */
440 char *characterString;
443 Z_External *external;
444 /* Z_IntUnit *integerAndUnit; */
449 typedef struct Z_AttributesPlusTerm
452 Z_AttributeElement **attributeList;
454 } Z_AttributesPlusTerm;
456 typedef struct Z_ResultSetPlusAttributes
460 Z_AttributeElement **attributeList;
461 } Z_ResultSetPlusAttributes;
463 typedef struct Z_ProximityOperator
465 bool_t *exclusion; /* OPTIONAL */
469 #define Z_Prox_lessThan 1
470 #define Z_Prox_lessThanOrEqual 2
471 #define Z_Prox_equal 3
472 #define Z_Prox_greaterThanOrEqual 4
473 #define Z_Prox_greaterThan 5
474 #define Z_Prox_notEqual 6
476 #define Z_ProxCode_known 0
477 #define Z_ProxCode_private 1
478 int *proximityUnitCode;
479 #define Z_ProxUnit_character 1
480 #define Z_ProxUnit_word 2
481 #define Z_ProxUnit_sentence 3
482 #define Z_ProxUnit_paragraph 4
483 #define Z_ProxUnit_section 5
484 #define Z_ProxUnit_chapter 6
485 #define Z_ProxUnit_document 7
486 #define Z_ProxUnit_element 8
487 #define Z_ProxUnit_subelement 9
488 #define Z_ProxUnit_elementType 10
489 #define Z_ProxUnit_byte 11 /* v3 only */
490 } Z_ProximityOperator;
492 typedef struct Z_Operator
495 #define Z_Operator_and 0
496 #define Z_Operator_or 1
497 #define Z_Operator_and_not 2
498 #define Z_Operator_prox 3
501 Odr_null *and; /* these guys are nulls. */
504 Z_ProximityOperator *prox;
508 typedef struct Z_Operand
511 #define Z_Operand_APT 0
512 #define Z_Operand_resultSetId 1
513 #define Z_Operand_resultAttr /* v3 only */ 2
516 Z_AttributesPlusTerm *attributesPlusTerm;
517 Z_ResultSetId *resultSetId;
518 Z_ResultSetPlusAttributes *resultAttr;
522 typedef struct Z_Complex
524 struct Z_RPNStructure *s1;
525 struct Z_RPNStructure *s2;
526 Z_Operator *roperator;
529 typedef struct Z_RPNStructure
532 #define Z_RPNStructure_simple 0
533 #define Z_RPNStructure_complex 1
541 typedef struct Z_RPNQuery
543 Odr_oid *attributeSetId;
544 Z_RPNStructure *RPNStructure;
547 /* -------------------------- SEARCHREQUEST -------------------------- */
549 typedef struct Z_Query
552 #define Z_Query_type_1 1
553 #define Z_Query_type_2 2
554 #define Z_Query_type_101 3
559 Z_RPNQuery *type_101;
563 typedef struct Z_SearchRequest
565 Z_ReferenceId *referenceId; /* OPTIONAL */
566 int *smallSetUpperBound;
567 int *largeSetLowerBound;
568 int *mediumSetPresentNumber;
569 bool_t *replaceIndicator;
571 int num_databaseNames;
572 char **databaseNames;
573 Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */
574 Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */
575 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
578 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */
579 Z_OtherInformation *otherInfo; /* OPTIONAL */
583 /* ------------------------ RECORD -------------------------- */
585 typedef Z_External Z_DatabaseRecord;
589 typedef struct Z_DefaultDiagFormat
591 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
593 /* until the whole character set issue becomes more definite,
594 * you can probably ignore this on input. */
596 #define Z_DiagForm_v2AddInfo 0
597 #define Z_DiagForm_v3AddInfo 1
599 } Z_DefaultDiagFormat;
601 typedef struct Z_DiagRec
604 #define Z_DiagRec_defaultFormat 0
605 #define Z_DiagRec_externallyDefined 1
608 Z_DefaultDiagFormat *defaultFormat;
609 Z_External *externallyDefined;
615 typedef struct Z_DiagRec
617 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
624 typedef struct Z_DiagRecs
627 Z_DiagRec **diagRecs;
630 typedef struct Z_NamePlusRecord
632 char *databaseName; /* OPTIONAL */
634 #define Z_NamePlusRecord_databaseRecord 0
635 #define Z_NamePlusRecord_surrogateDiagnostic 1
638 Z_DatabaseRecord *databaseRecord;
639 Z_DiagRec *surrogateDiagnostic;
643 typedef struct Z_NamePlusRecordList
646 Z_NamePlusRecord **records;
647 } Z_NamePlusRecordList;
649 typedef struct Z_Records
652 #define Z_Records_DBOSD 0
653 #define Z_Records_NSD 1
654 #define Z_Records_multipleNSD 2
657 Z_NamePlusRecordList *databaseOrSurDiagnostics;
658 Z_DiagRec *nonSurrogateDiagnostic;
659 Z_DiagRecs *multipleNonSurDiagnostics;
663 /* ------------------------ SEARCHRESPONSE ------------------ */
665 typedef struct Z_SearchResponse
667 Z_ReferenceId *referenceId; /* OPTIONAL */
669 int *numberOfRecordsReturned;
670 int *nextResultSetPosition;
671 bool_t *searchStatus;
672 int *resultSetStatus; /* OPTIONAL */
673 #define Z_RES_SUBSET 1
674 #define Z_RES_INTERIM 2
676 int *presentStatus; /* OPTIONAL */
677 #define Z_PRES_SUCCESS 0
678 #define Z_PRES_PARTIAL_1 1
679 #define Z_PRES_PARTIAL_2 2
680 #define Z_PRES_PARTIAL_3 3
681 #define Z_PRES_PARTIAL_4 4
682 #define Z_PRES_FAILURE 5
683 Z_Records *records; /* OPTIONAL */
685 Z_OtherInformation *additionalSearchInfo;
686 Z_OtherInformation *otherInfo;
690 /* ------------------------- PRESENT SERVICE -----------------*/
692 typedef struct Z_ElementSpec
695 #define Z_ElementSpec_elementSetName 0
696 #define Z_ElementSpec_externalSpec 1
699 char *elementSetName;
700 Z_External *externalSpec;
704 typedef struct Z_Specification
706 Odr_oid *schema; /* OPTIONAL */
707 Z_ElementSpec *elementSpec; /* OPTIONAL */
710 typedef struct Z_DbSpecific
713 Z_Specification *spec;
716 typedef struct Z_CompSpec
718 bool_t *selectAlternativeSyntax;
719 Z_Specification *generic; /* OPTIONAL */
721 Z_DbSpecific **dbSpecific; /* OPTIONAL */
722 int num_recordSyntax;
723 Odr_oid **recordSyntax; /* OPTIONAL */
726 typedef struct Z_RecordComposition
729 #define Z_RecordComp_simple 0
730 #define Z_RecordComp_complex 1
733 Z_ElementSetNames *simple;
736 } Z_RecordComposition;
738 typedef struct Z_Range
740 int *startingPosition;
741 int *numberOfRecords;
744 typedef struct Z_PresentRequest
746 Z_ReferenceId *referenceId; /* OPTIONAL */
747 Z_ResultSetId *resultSetId;
748 int *resultSetStartPoint;
749 int *numberOfRecordsRequested;
752 Z_Range **additionalRanges; /* OPTIONAL */
753 Z_RecordComposition *recordComposition; /* OPTIONAL */
755 Z_ElementSetNames *elementSetNames; /* OPTIONAL */
757 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
759 int *maxSegmentCount; /* OPTIONAL */
760 int *maxRecordSize; /* OPTIONAL */
761 int *maxSegmentSize; /* OPTIONAL */
762 Z_OtherInformation *otherInfo; /* OPTIONAL */
766 typedef struct Z_PresentResponse
768 Z_ReferenceId *referenceId; /* OPTIONAL */
769 int *numberOfRecordsReturned;
770 int *nextResultSetPosition;
774 Z_OtherInformation *otherInfo; /* OPTIONAL */
778 /* ------------------ RESOURCE CONTROL ----------------*/
780 typedef struct Z_TriggerResourceControlRequest
782 Z_ReferenceId *referenceId; /* OPTIONAL */
783 int *requestedAction;
784 #define Z_TriggerResourceCtrl_resourceReport 1
785 #define Z_TriggerResourceCtrl_resourceControl 2
786 #define Z_TriggerResourceCtrl_cancel 3
787 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
788 bool_t *resultSetWanted; /* OPTIONAL */
790 Z_OtherInformation *otherInfo;
792 } Z_TriggerResourceControlRequest;
794 typedef struct Z_ResourceControlRequest
796 Z_ReferenceId *referenceId; /* OPTIONAL */
797 bool_t *suspendedFlag; /* OPTIONAL */
798 Z_External *resourceReport; /* OPTIONAL */
799 int *partialResultsAvailable; /* OPTIONAL */
800 #define Z_ResourceControlRequest_subset 1
801 #define Z_ResourceControlRequest_interim 2
802 #define Z_ResourceControlRequest_none 3
803 bool_t *responseRequired;
804 bool_t *triggeredRequestFlag; /* OPTIONAL */
806 Z_OtherInformation *otherInfo;
808 } Z_ResourceControlRequest;
810 typedef struct Z_ResourceControlResponse
812 Z_ReferenceId *referenceId; /* OPTIONAL */
813 bool_t *continueFlag;
814 bool_t *resultSetWanted; /* OPTIONAL */
816 Z_OtherInformation *otherInfo;
818 } Z_ResourceControlResponse;
821 /* ------------------ ACCESS CTRL SERVICE ----------------*/
823 typedef struct Z_AccessControlRequest
825 Z_ReferenceId *referenceId; /* OPTIONAL */
827 #define Z_AccessRequest_simpleForm 0
828 #define Z_AccessRequest_externallyDefined 1
832 Z_External *externallyDefined;
835 Z_OtherInformation *otherInfo; /* OPTIONAL */
837 } Z_AccessControlRequest;
839 typedef struct Z_AccessControlResponse
841 Z_ReferenceId *referenceId; /* OPTIONAL */
843 #define Z_AccessResponse_simpleForm 0
844 #define Z_AccessResponse_externallyDefined 1
848 Z_External *externallyDefined;
850 Z_DiagRec *diagnostic; /* OPTIONAL */
852 Z_OtherInformation *otherInfo; /* OPTIONAL */
854 } Z_AccessControlResponse;
856 /* ------------------------ SCAN SERVICE -------------------- */
858 typedef struct Z_AttributeList
861 Z_AttributeElement **attributes;
864 typedef struct Z_AlternativeTerm
867 Z_AttributesPlusTerm **terms;
872 typedef struct Z_ByDatabase
875 int *num; /* OPTIONAL */
876 Z_OtherInformation *otherDbInfo; /* OPTIONAL */
879 typedef struct Z_ByDatabaseList
882 Z_ByDatabase **elements;
885 typedef struct Z_ScanOccurrences
888 #define Z_ScanOccurrences_global 0
889 #define Z_ScanOccurrences_byDatabase 1
893 Z_ByDatabaseList *byDatabase;
898 typedef struct Z_OccurrenceByAttributesElem
900 Z_AttributeList *attributes;
901 Z_ScanOccurrences *occurrences; /* OPTIONAL */
902 Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
903 } Z_OccurrenceByAttributesElem;
905 typedef struct Z_OccurrenceByAttributes
908 Z_OccurrenceByAttributesElem **elements;
909 } Z_OccurrenceByAttributes;
914 * Old, incomplete definition of OccurrenceByAttributes.
917 typedef struct Z_OccurrenceByAttributes
919 Z_AttributeList *attributes;
922 #define Z_OByAtt_global 0
923 #define Z_ObyAtt_byDatabase 1
929 /* Z_ByDatabase *byDatabase; */
932 } Z_OccurrenceByAttributes;
936 typedef struct Z_TermInfo
939 char *displayTerm; /* OPTIONAL */
940 Z_AttributeList *suggestedAttributes; /* OPTIONAL */
941 Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
942 int *globalOccurrences; /* OPTIONAL */
943 Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
944 Z_OtherInformation *otherTermInfo; /* OPTIONAL */
947 typedef struct Z_Entry
950 #define Z_Entry_termInfo 0
951 #define Z_Entry_surrogateDiagnostic 1
954 Z_TermInfo *termInfo;
955 Z_DiagRec *surrogateDiagnostic;
959 typedef struct Z_Entries
965 typedef struct Z_ListEntries
968 #define Z_ListEntries_entries 0
969 #define Z_ListEntries_nonSurrogateDiagnostics 1
973 Z_DiagRecs *nonSurrogateDiagnostics;
977 typedef struct Z_ScanRequest
979 Z_ReferenceId *referenceId; /* OPTIONAL */
980 int num_databaseNames;
981 char **databaseNames;
982 Odr_oid *attributeSet; /* OPTIONAL */
983 Z_AttributesPlusTerm *termListAndStartPoint;
984 int *stepSize; /* OPTIONAL */
985 int *numberOfTermsRequested;
986 int *preferredPositionInResponse; /* OPTIONAL */
988 Z_OtherInformation *otherInfo;
992 typedef struct Z_ScanResponse
994 Z_ReferenceId *referenceId; /* OPTIONAL */
995 int *stepSize; /* OPTIONAL */
997 #define Z_Scan_success 0
998 #define Z_Scan_partial_1 1
999 #define Z_Scan_partial_2 2
1000 #define Z_Scan_partial_3 3
1001 #define Z_Scan_partial_4 4
1002 #define Z_Scan_partial_5 5
1003 #define Z_Scan_failure 6
1004 int *numberOfEntriesReturned;
1005 int *positionOfTerm; /* OPTIONAL */
1006 Z_ListEntries *entries; /* OPTIONAL */
1007 Odr_oid *attributeSet; /* OPTIONAL */
1009 Z_OtherInformation *otherInfo;
1014 /* ------------------------ DELETE -------------------------- */
1016 #define Z_DeleteStatus_success 0
1017 #define Z_DeleteStatus_resultSetDidNotExist 1
1018 #define Z_DeleteStatus_previouslyDeletedByTarget 2
1019 #define Z_DeleteStatus_systemProblemAtTarget 3
1020 #define Z_DeleteStatus_accessNotAllowed 4
1021 #define Z_DeleteStatus_resourceControlAtOrigin 5
1022 #define Z_DeleteStatus_resourceControlAtTarget 6
1023 #define Z_DeleteStatus_bulkDeleteNotSupported 7
1024 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
1025 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
1026 #define Z_DeleteStatus_resultSetInUse 10
1028 typedef struct Z_ListStatus
1034 typedef struct Z_DeleteResultSetRequest
1036 Z_ReferenceId *referenceId; /* OPTIONAL */
1037 int *deleteFunction;
1038 #define Z_DeleteRequest_list 0
1039 #define Z_DeleteRequest_all 1
1041 Z_ResultSetId **resultSetList; /* OPTIONAL */
1043 Z_OtherInformation *otherInfo;
1045 } Z_DeleteResultSetRequest;
1047 typedef struct Z_DeleteResultSetResponse
1049 Z_ReferenceId *referenceId; /* OPTIONAL */
1050 int *deleteOperationStatus;
1052 Z_ListStatus **deleteListStatuses; /* OPTIONAL */
1053 int *numberNotDeleted; /* OPTIONAL */
1054 int num_bulkStatuses;
1055 Z_ListStatus **bulkStatuses; /* OPTIONAL */
1056 char *deleteMessage; /* OPTIONAL */
1058 Z_OtherInformation *otherInfo;
1060 } Z_DeleteResultSetResponse;
1062 /* ------------------------ CLOSE SERVICE ------------------- */
1064 typedef struct Z_Close
1066 Z_ReferenceId *referenceId; /* OPTIONAL */
1068 #define Z_Close_finished 0
1069 #define Z_Close_shutdown 1
1070 #define Z_Close_systemProblem 2
1071 #define Z_Close_costLimit 3
1072 #define Z_Close_resources 4
1073 #define Z_Close_securityViolation 5
1074 #define Z_Close_protocolError 6
1075 #define Z_Close_lackOfActivity 7
1076 #define Z_Close_peerAbort 8
1077 #define Z_Close_unspecified 9
1078 char *diagnosticInformation; /* OPTIONAL */
1079 Odr_oid *resourceReportFormat; /* OPTIONAL */
1080 Z_External *resourceReport; /* OPTIONAL */
1082 Z_OtherInformation *otherInfo; /* OPTIONAL */
1086 /* ------------------------ SEGMENTATION -------------------- */
1088 typedef struct Z_Segment
1090 Z_ReferenceId *referenceId; /* OPTIONAL */
1091 int *numberOfRecordsReturned;
1092 int num_segmentRecords;
1093 Z_NamePlusRecord **segmentRecords;
1094 Z_OtherInformation *otherInfo; /* OPTIONAL */
1097 /* ----------------------- Extended Services ---------------- */
1099 typedef struct Z_Permissions
1102 int num_allowableFunctions;
1103 int **allowableFunctions;
1104 #define Z_Permissions_delete 1
1105 #define Z_Permissions_modifyContents 2
1106 #define Z_Permissions_modifyPermissions 3
1107 #define Z_Permissions_present 4
1108 #define Z_Permissions_invoke 5
1111 typedef struct Z_ExtendedServicesRequest
1113 Z_ReferenceId *referenceId; /* OPTIONAL */
1115 #define Z_ExtendedServicesRequest_create 1
1116 #define Z_ExtendedServicesRequest_delete 2
1117 #define Z_ExtendedServicesRequest_modify 3
1118 Odr_oid *packageType;
1119 char *packageName; /* OPTIONAL */
1120 char *userId; /* OPTIONAL */
1121 Z_IntUnit *retentionTime; /* OPTIONAL */
1122 Z_Permissions *permissions; /* OPTIONAL */
1123 char *description; /* OPTIONAL */
1124 Z_External *taskSpecificParameters; /* OPTIONAL */
1126 #define Z_ExtendedServicesRequest_wait 1
1127 #define Z_ExtendedServicesRequest_waitIfPossible 2
1128 #define Z_ExtendedServicesRequest_dontWait 3
1129 #define Z_ExtendedServicesRequest_dontReturnPackage 4
1130 char *elements; /* OPTIONAL */
1131 Z_OtherInformation *otherInfo; /* OPTIONAL */
1132 } Z_ExtendedServicesRequest;
1134 typedef struct Z_ExtendedServicesResponse
1136 Z_ReferenceId *referenceId; /* OPTIONAL */
1137 int *operationStatus;
1138 #define Z_ExtendedServicesResponse_done 1
1139 #define Z_ExtendedServicesResponse_accepted 2
1140 #define Z_ExtendedServicesResponse_failure 3
1141 int num_diagnostics;
1142 Z_DiagRec **diagnostics; /* OPTIONAL */
1143 Z_External *taskPackage; /* OPTIONAL */
1144 Z_OtherInformation *otherInfo; /* OPTIONAL */
1145 } Z_ExtendedServicesResponse;
1147 /* ------------------------ Sort --------------------------- */
1149 typedef struct Z_SortAttributes
1152 Z_AttributeList *list;
1155 typedef struct Z_SortKey
1158 #define Z_SortKey_sortField 0
1159 #define Z_SortKey_elementSpec 1
1160 #define Z_SortKey_sortAttributes 2
1164 Z_Specification *elementSpec;
1165 Z_SortAttributes *sortAttributes;
1169 typedef struct Z_SortDbSpecific
1175 typedef struct Z_SortDbSpecificList
1178 Z_SortDbSpecific **dbSpecific;
1179 } Z_SortDbSpecificList;
1181 typedef struct Z_SortElement
1184 #define Z_SortElement_generic 0
1185 #define Z_SortElement_databaseSpecific 1
1189 Z_SortDbSpecificList *databaseSpecific;
1193 typedef struct Z_SortMissingValueAction
1196 #define Z_SortMissingValAct_abort 0
1197 #define Z_SortMissingValAct_null 1
1198 #define Z_SortMissingValAct_valData 2
1205 } Z_SortMissingValueAction;
1207 typedef struct Z_SortKeySpec
1209 Z_SortElement *sortElement;
1211 #define Z_SortRelation_ascending 0
1212 #define Z_SortRelation_descending 1
1213 #define Z_SortRelation_ascendingByFreq 3
1214 #define Z_SortRelation_descendingByFreq 4
1215 int *caseSensitivity;
1216 #define Z_SortCase_caseSensitive 0
1217 #define Z_SortCase_caseInsensitive 1
1218 Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
1221 typedef struct Z_SortResponse
1223 Z_ReferenceId *referenceId; /* OPTIONAL */
1225 #define Z_SortStatus_success 0
1226 #define Z_SortStatus_partial_1 1
1227 #define Z_SortStatus_failure 2
1228 int *resultSetStatus; /* OPTIONAL */
1229 #define Z_SortResultSetStatus_empty 1
1230 #define Z_SortResultSetStatus_interim 2
1231 #define Z_SortResultSetStatus_unchanged 3
1232 #define Z_SortResultSetStatus_none 4
1233 Z_DiagRecs *diagnostics; /* OPTIONAL */
1234 Z_OtherInformation *otherInfo; /* OPTIONAL */
1237 typedef struct Z_SortKeySpecList
1240 Z_SortKeySpec **specs;
1241 } Z_SortKeySpecList;
1243 typedef struct Z_SortRequest
1245 Z_ReferenceId *referenceId; /* OPTIONAL */
1246 Z_StringList *inputResultSetNames;
1247 char *sortedResultSetName;
1248 Z_SortKeySpecList *sortSequence;
1249 Z_OtherInformation *otherInfo; /* OPTIONAL */
1252 /* ----------------------- Resource Report ------------------ */
1254 typedef struct Z_ResourceReportRequest
1256 Z_ReferenceId *referenceId; /* OPTIONAL */
1257 Z_ReferenceId *opId; /* OPTIONAL */
1258 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
1259 Z_OtherInformation *otherInfo; /* OPTIONAL */
1260 } Z_ResourceReportRequest;
1262 typedef struct Z_ResourceReportResponse
1264 Z_ReferenceId *referenceId; /* OPTIONAL */
1265 int *resourceReportStatus;
1266 #define Z_ResourceReportStatus_success 0
1267 #define Z_ResourceReportStatus_partial 1
1268 #define Z_ResourceReportStatus_failure_1 2
1269 #define Z_ResourceReportStatus_failure_2 3
1270 #define Z_ResourceReportStatus_failure_3 4
1271 #define Z_ResourceReportStatus_failure_4 5
1272 #define Z_ResourceReportStatus_failure_5 6
1273 #define Z_ResourceReportStatus_failure_6 7
1274 Z_External *resourceReport; /* OPTIONAL */
1275 Z_OtherInformation *otherInfo; /* OPTIONAL */
1276 } Z_ResourceReportResponse;
1278 /* ------------------------ APDU ---------------------------- */
1280 typedef struct Z_APDU
1283 #define Z_APDU_initRequest 0
1284 #define Z_APDU_initResponse 1
1285 #define Z_APDU_searchRequest 2
1286 #define Z_APDU_searchResponse 3
1287 #define Z_APDU_presentRequest 4
1288 #define Z_APDU_presentResponse 5
1289 #define Z_APDU_deleteResultSetRequest 6
1290 #define Z_APDU_deleteResultSetResponse 7
1291 #define Z_APDU_resourceControlRequest 8
1292 #define Z_APDU_resourceControlResponse 9
1293 #define Z_APDU_triggerResourceControlRequest 10
1294 #define Z_APDU_scanRequest 11
1295 #define Z_APDU_scanResponse 12
1296 #define Z_APDU_segmentRequest 13
1297 #define Z_APDU_extendedServicesRequest 14
1298 #define Z_APDU_extendedServicesResponse 15
1299 #define Z_APDU_close 16
1300 #define Z_APDU_accessControlRequest 17
1301 #define Z_APDU_accessControlResponse 18
1302 #define Z_APDU_sortRequest 20
1303 #define Z_APDU_sortResponse 21
1304 #define Z_APDU_resourceReportRequest 22
1305 #define Z_APDU_resourceReportResponse 23
1308 Z_InitRequest *initRequest;
1309 Z_InitResponse *initResponse;
1310 Z_SearchRequest *searchRequest;
1311 Z_SearchResponse *searchResponse;
1312 Z_PresentRequest *presentRequest;
1313 Z_PresentResponse *presentResponse;
1314 Z_DeleteResultSetRequest *deleteResultSetRequest;
1315 Z_DeleteResultSetResponse *deleteResultSetResponse;
1316 Z_AccessControlRequest *accessControlRequest;
1317 Z_AccessControlResponse *accessControlResponse;
1318 Z_ResourceControlRequest *resourceControlRequest;
1319 Z_ResourceControlResponse *resourceControlResponse;
1320 Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1321 Z_ResourceReportRequest *resourceReportRequest;
1322 Z_ResourceReportResponse *resourceReportResponse;
1323 Z_ScanRequest *scanRequest;
1324 Z_ScanResponse *scanResponse;
1325 Z_SortRequest *sortRequest;
1326 Z_SortResponse *sortResponse;
1327 Z_Segment *segmentRequest;
1328 Z_ExtendedServicesRequest *extendedServicesRequest;
1329 Z_ExtendedServicesResponse *extendedServicesResponse;
1334 YAZ_EXPORT int z_APDU(ODR o, Z_APDU **p, int opt);
1335 YAZ_EXPORT int z_SUTRS(ODR o, Odr_oct **p, int opt);
1337 YAZ_EXPORT Z_InitRequest *zget_InitRequest(ODR o);
1338 YAZ_EXPORT Z_InitResponse *zget_InitResponse(ODR o);
1339 YAZ_EXPORT Z_SearchRequest *zget_SearchRequest(ODR o);
1340 YAZ_EXPORT Z_SearchResponse *zget_SearchResponse(ODR o);
1341 YAZ_EXPORT Z_PresentRequest *zget_PresentRequest(ODR o);
1342 YAZ_EXPORT Z_PresentResponse *zget_PresentResponse(ODR o);
1343 YAZ_EXPORT Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1344 YAZ_EXPORT Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1345 YAZ_EXPORT Z_ScanRequest *zget_ScanRequest(ODR o);
1346 YAZ_EXPORT Z_ScanResponse *zget_ScanResponse(ODR o);
1347 YAZ_EXPORT Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1348 YAZ_EXPORT Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1349 YAZ_EXPORT Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1350 YAZ_EXPORT Z_Close *zget_Close(ODR o);
1351 YAZ_EXPORT int z_StringList(ODR o, Z_StringList **p, int opt);
1352 YAZ_EXPORT int z_InternationalString(ODR o, char **p, int opt);
1353 YAZ_EXPORT int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt);
1354 YAZ_EXPORT int z_ElementSetName(ODR o, char **p, int opt);
1355 YAZ_EXPORT int z_IntUnit(ODR o, Z_IntUnit **p, int opt);
1356 YAZ_EXPORT int z_Unit(ODR o, Z_Unit **p, int opt);
1357 YAZ_EXPORT int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt);
1358 YAZ_EXPORT int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt);
1359 YAZ_EXPORT int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt);
1360 YAZ_EXPORT int z_Term(ODR o, Z_Term **p, int opt);
1361 YAZ_EXPORT int z_Specification(ODR o, Z_Specification **p, int opt);
1362 YAZ_EXPORT int z_Permissions(ODR o, Z_Permissions **p, int opt);
1363 YAZ_EXPORT int z_DiagRec(ODR o, Z_DiagRec **p, int opt);
1364 YAZ_EXPORT int z_AttributeList(ODR o, Z_AttributeList **p, int opt);
1365 YAZ_EXPORT int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt);
1366 YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which);
1367 YAZ_EXPORT int z_Query(ODR o, Z_Query **p, int opt);
1373 #include <prt-rsc.h>
1374 #include <prt-acc.h>
1375 #include <prt-exp.h>
1376 #include <prt-grs.h>
1377 #include <prt-arc.h>
1378 #include <prt-exd.h>
1379 #include <prt-dia.h>
1380 #include <prt-esp.h>
1381 #include <prt-add.h>
1383 #include <prt-ext.h>