2 * Copyright (c) 1995-1998, 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.44 1998-05-18 10:14:08 adam
28 * Minor change - removed 'dead' definitions.
30 * Revision 1.43 1998/03/31 11:07:45 adam
31 * Furhter work on UNIverse resource report.
32 * Added Extended Services handling in frontend server.
34 * Revision 1.42 1998/03/20 14:46:06 adam
35 * Added UNIverse Resource Reports.
37 * Revision 1.41 1998/02/10 15:31:52 adam
38 * Implemented date and time structure. Changed the Update Extended
41 * Revision 1.40 1997/09/01 08:49:50 adam
42 * New windows NT/95 port using MSV5.0. To export DLL functions the
43 * YAZ_EXPORT modifier was added. Defined in yconfig.h.
45 * Revision 1.39 1997/05/14 06:53:44 adam
48 * Revision 1.38 1997/04/30 08:52:09 quinn
51 * Revision 1.37 1996/10/09 15:54:58 quinn
52 * Added SearchInfoReport
54 * Revision 1.36 1996/10/07 15:29:20 quinn
57 * Revision 1.35 1996/06/10 08:57:38 quinn
58 * Added OPAC, ResourceReport
60 * Revision 1.34 1996/06/10 08:55:36 quinn
63 * Revision 1.33 1996/02/23 10:00:51 quinn
66 * Revision 1.32 1996/02/20 12:52:39 quinn
69 * Revision 1.31 1996/01/22 09:46:45 quinn
70 * Added Sort PDU. Moved StringList to main protocol file.
72 * Revision 1.30 1996/01/10 15:21:32 quinn
73 * Added links to access control PDUs
75 * Revision 1.29 1996/01/02 11:46:49 quinn
76 * Changed 'operator' to 'roperator' to avoid C++ conflict.
79 * Revision 1.28 1996/01/02 08:57:32 quinn
80 * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
82 * Revision 1.27 1995/10/12 10:34:46 quinn
85 * Revision 1.26 1995/09/29 17:12:08 quinn
88 * Revision 1.25 1995/09/27 15:02:49 quinn
89 * Modified function heads & prototypes.
91 * Revision 1.24 1995/08/29 11:17:43 quinn
92 * *** empty log message ***
94 * Revision 1.23 1995/08/21 09:10:36 quinn
95 * Smallish fixes to suppport new formats.
97 * Revision 1.22 1995/08/17 12:45:14 quinn
98 * Fixed minor problems with GRS-1. Added support in c&s.
100 * Revision 1.21 1995/08/15 12:00:11 quinn
103 * Revision 1.20 1995/08/10 08:54:35 quinn
106 * Revision 1.19 1995/06/19 12:38:28 quinn
107 * Reorganized include-files. Added small features.
109 * Revision 1.18 1995/06/16 13:16:05 quinn
110 * Fixed Defaultdiagformat.
112 * Revision 1.17 1995/06/15 15:42:05 quinn
115 * Revision 1.16 1995/06/15 07:45:06 quinn
118 * Revision 1.15 1995/06/14 15:26:43 quinn
119 * *** empty log message ***
121 * Revision 1.14 1995/06/07 14:42:34 quinn
124 * Revision 1.13 1995/06/07 14:36:47 quinn
127 * Revision 1.12 1995/06/05 10:53:13 quinn
130 * Revision 1.11 1995/06/02 09:49:47 quinn
133 * Revision 1.10 1995/05/29 08:11:34 quinn
134 * Moved oid from odr/asn to util.
136 * Revision 1.9 1995/05/22 11:31:25 quinn
139 * Revision 1.8 1995/05/17 08:41:35 quinn
140 * Added delete to proto & other little things.
141 * Relaying auth info to backend.
143 * Revision 1.7 1995/05/16 08:50:37 quinn
144 * License, documentation, and memory fixes
146 * Revision 1.6 1995/05/15 11:55:55 quinn
147 * Work on asynchronous activity.
149 * Revision 1.5 1995/04/17 11:28:18 quinn
152 * Revision 1.4 1995/04/10 10:22:47 quinn
155 * Revision 1.3 1995/03/30 12:18:09 quinn
158 * Revision 1.2 1995/03/30 10:26:48 quinn
159 * Added Term structure
161 * Revision 1.1 1995/03/30 09:39:42 quinn
162 * Moved .h files to include directory
164 * Revision 1.11 1995/03/30 09:08:44 quinn
165 * Added Resource control protocol
167 * Revision 1.10 1995/03/29 15:39:39 quinn
168 * Adding some resource control elements, and a null-check to getentbyoid
170 * Revision 1.9 1995/03/29 08:06:18 quinn
171 * Added a few v3 elements
173 * Revision 1.8 1995/03/22 10:12:49 quinn
174 * Added Z_PRES constants.
176 * Revision 1.7 1995/03/20 09:45:12 quinn
179 * Revision 1.5 1995/03/07 16:29:34 quinn
180 * Added authentication stuff.
182 * Revision 1.4 1995/03/07 10:13:00 quinn
183 * Added prototype for z_APDU()
185 * Revision 1.3 1995/02/14 11:54:23 quinn
188 * Revision 1.2 1995/02/09 15:51:40 quinn
191 * Revision 1.1 1995/02/06 16:44:48 quinn
192 * First hack at Z/SR protocol
203 #include <yaz-version.h>
210 * Because we didn't have time to put all of the extra v3 elements in here
211 * before the first applications were written, we have to place them
212 * in #ifdefs in places where they would break existing code. If you are
213 * developing new stuff, we urge you to leave them in, even if you don't
214 * intend to use any v3 features. When we are comfortable that the old
215 * apps have been updated, we'll remove the #ifdefs.
220 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
223 typedef struct Z_External Z_External;
225 typedef Odr_oct Z_ReferenceId;
226 typedef char Z_DatabaseName;
227 typedef char Z_ResultSetId;
228 typedef Odr_oct Z_ResultsetId;
230 typedef struct Z_InfoCategory
232 Odr_oid *categoryTypeId; /* OPTIONAL */
236 typedef struct Z_OtherInformationUnit
238 Z_InfoCategory *category; /* OPTIONAL */
240 #define Z_OtherInfo_characterInfo 0
241 #define Z_OtherInfo_binaryInfo 1
242 #define Z_OtherInfo_externallyDefinedInfo 2
243 #define Z_OtherInfo_oid 3
248 Z_External *externallyDefinedInfo;
251 } Z_OtherInformationUnit;
253 typedef struct Z_OtherInformation
256 Z_OtherInformationUnit **list;
257 } Z_OtherInformation;
259 typedef struct Z_StringOrNumeric
262 #define Z_StringOrNumeric_string 0
263 #define Z_StringOrNumeric_numeric 1
271 typedef struct Z_Unit
273 char *unitSystem; /* OPTIONAL */
274 Z_StringOrNumeric *unitType; /* OPTIONAL */
275 Z_StringOrNumeric *unit; /* OPTIONAL */
276 int *scaleFactor; /* OPTIONAL */
279 typedef struct Z_IntUnit
285 typedef Odr_oct Z_SUTRS;
287 typedef struct Z_StringList
293 /* ----------------- INIT SERVICE ----------------*/
297 char *groupId; /* OPTIONAL */
298 char *userId; /* OPTIONAL */
299 char *password; /* OPTIONAL */
302 typedef struct Z_IdAuthentication
305 #define Z_IdAuthentication_open 0
306 #define Z_IdAuthentication_idPass 1
307 #define Z_IdAuthentication_anonymous 2
308 #define Z_IdAuthentication_other 3
316 } Z_IdAuthentication;
318 #define Z_ProtocolVersion_1 0
319 #define Z_ProtocolVersion_2 1
320 #define Z_ProtocolVersion_3 2
322 #define Z_Options_search 0
323 #define Z_Options_present 1
324 #define Z_Options_delSet 2
325 #define Z_Options_resourceReport 3
326 #define Z_Options_triggerResourceCtrl 4
327 #define Z_Options_resourceCtrl 5
328 #define Z_Options_accessCtrl 6
329 #define Z_Options_scan 7
330 #define Z_Options_sort 8
331 #define Z_Options_reserved 9
332 #define Z_Options_extendedServices 10
333 #define Z_Options_level_1Segmentation 11
334 #define Z_Options_level_2Segmentation 12
335 #define Z_Options_concurrentOperations 13
336 #define Z_Options_namedResultSets 14
338 typedef struct Z_InitRequest
340 Z_ReferenceId *referenceId; /* OPTIONAL */
341 Odr_bitmask *protocolVersion;
342 Odr_bitmask *options;
343 int *preferredMessageSize;
344 int *maximumRecordSize;
345 Z_IdAuthentication* idAuthentication; /* OPTIONAL */
346 char *implementationId; /* OPTIONAL */
347 char *implementationName; /* OPTIONAL */
348 char *implementationVersion; /* OPTIONAL */
349 Z_External *userInformationField; /* OPTIONAL */
351 Z_OtherInformation *otherInfo; /* OPTIONAL */
355 typedef struct Z_InitResponse
357 Z_ReferenceId *referenceId; /* OPTIONAL */
358 Odr_bitmask *protocolVersion;
359 Odr_bitmask *options;
360 int *preferredMessageSize;
361 int *maximumRecordSize;
363 char *implementationId; /* OPTIONAL */
364 char *implementationName; /* OPTIONAL */
365 char *implementationVersion; /* OPTIONAL */
366 Z_External *userInformationField; /* OPTIONAL */
368 Z_OtherInformation *otherInfo; /* OPTIONAL */
372 typedef struct Z_NSRAuthentication
377 } Z_NSRAuthentication;
379 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
381 int z_StrAuthentication(ODR o, char **p, int opt);
383 /* ------------------ SEARCH SERVICE ----------------*/
385 typedef struct Z_DatabaseSpecificUnit
388 char *elementSetName;
389 } Z_DatabaseSpecificUnit;
391 typedef struct Z_DatabaseSpecific
394 Z_DatabaseSpecificUnit **elements;
395 } Z_DatabaseSpecific;
397 typedef struct Z_ElementSetNames
400 #define Z_ElementSetNames_generic 0
401 #define Z_ElementSetNames_databaseSpecific 1
405 Z_DatabaseSpecific *databaseSpecific;
409 /* ---------------------- RPN QUERY --------------------------- */
411 typedef struct Z_ComplexAttribute
414 Z_StringOrNumeric **list;
415 int num_semanticAction;
416 int **semanticAction; /* OPTIONAL */
417 } Z_ComplexAttribute;
419 typedef struct Z_AttributeElement
422 Odr_oid *attributeSet; /* OPTIONAL - v3 only */
427 #define Z_AttributeValue_numeric 0
428 #define Z_AttributeValue_complex 1
432 Z_ComplexAttribute *complex;
437 } Z_AttributeElement;
439 typedef struct Z_Term
442 #define Z_Term_general 0
443 #define Z_Term_numeric 1
444 #define Z_Term_characterString 2
446 #define Z_Term_dateTime 4
447 #define Z_Term_external 5
448 #define Z_Term_integerAndUnit 6
449 #define Z_Term_null 7
452 Odr_oct *general; /* this is required for v2 */
454 char *characterString;
457 Z_External *external;
458 /* Z_IntUnit *integerAndUnit; */
463 typedef struct Z_AttributesPlusTerm
466 Z_AttributeElement **attributeList;
468 } Z_AttributesPlusTerm;
470 typedef struct Z_ResultSetPlusAttributes
474 Z_AttributeElement **attributeList;
475 } Z_ResultSetPlusAttributes;
477 typedef struct Z_ProximityOperator
479 bool_t *exclusion; /* OPTIONAL */
483 #define Z_Prox_lessThan 1
484 #define Z_Prox_lessThanOrEqual 2
485 #define Z_Prox_equal 3
486 #define Z_Prox_greaterThanOrEqual 4
487 #define Z_Prox_greaterThan 5
488 #define Z_Prox_notEqual 6
490 #define Z_ProxCode_known 0
491 #define Z_ProxCode_private 1
492 int *proximityUnitCode;
493 #define Z_ProxUnit_character 1
494 #define Z_ProxUnit_word 2
495 #define Z_ProxUnit_sentence 3
496 #define Z_ProxUnit_paragraph 4
497 #define Z_ProxUnit_section 5
498 #define Z_ProxUnit_chapter 6
499 #define Z_ProxUnit_document 7
500 #define Z_ProxUnit_element 8
501 #define Z_ProxUnit_subelement 9
502 #define Z_ProxUnit_elementType 10
503 #define Z_ProxUnit_byte 11 /* v3 only */
504 } Z_ProximityOperator;
506 typedef struct Z_Operator
509 #define Z_Operator_and 0
510 #define Z_Operator_or 1
511 #define Z_Operator_and_not 2
512 #define Z_Operator_prox 3
515 Odr_null *and; /* these guys are nulls. */
518 Z_ProximityOperator *prox;
522 typedef struct Z_Operand
525 #define Z_Operand_APT 0
526 #define Z_Operand_resultSetId 1
527 #define Z_Operand_resultAttr /* v3 only */ 2
530 Z_AttributesPlusTerm *attributesPlusTerm;
531 Z_ResultSetId *resultSetId;
532 Z_ResultSetPlusAttributes *resultAttr;
536 typedef struct Z_Complex
538 struct Z_RPNStructure *s1;
539 struct Z_RPNStructure *s2;
540 Z_Operator *roperator;
543 typedef struct Z_RPNStructure
546 #define Z_RPNStructure_simple 0
547 #define Z_RPNStructure_complex 1
555 typedef struct Z_RPNQuery
557 Odr_oid *attributeSetId;
558 Z_RPNStructure *RPNStructure;
561 /* -------------------------- SEARCHREQUEST -------------------------- */
563 typedef struct Z_Query
566 #define Z_Query_type_1 1
567 #define Z_Query_type_2 2
568 #define Z_Query_type_101 3
573 Z_RPNQuery *type_101;
577 typedef struct Z_SearchRequest
579 Z_ReferenceId *referenceId; /* OPTIONAL */
580 int *smallSetUpperBound;
581 int *largeSetLowerBound;
582 int *mediumSetPresentNumber;
583 bool_t *replaceIndicator;
585 int num_databaseNames;
586 char **databaseNames;
587 Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */
588 Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */
589 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
592 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */
593 Z_OtherInformation *otherInfo; /* OPTIONAL */
597 /* ------------------------ RECORD -------------------------- */
599 typedef Z_External Z_DatabaseRecord;
603 typedef struct Z_DefaultDiagFormat
605 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
607 /* until the whole character set issue becomes more definite,
608 * you can probably ignore this on input. */
610 #define Z_DiagForm_v2AddInfo 0
611 #define Z_DiagForm_v3AddInfo 1
613 } Z_DefaultDiagFormat;
615 typedef struct Z_DiagRec
618 #define Z_DiagRec_defaultFormat 0
619 #define Z_DiagRec_externallyDefined 1
622 Z_DefaultDiagFormat *defaultFormat;
623 Z_External *externallyDefined;
629 typedef struct Z_DiagRec
631 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
638 typedef struct Z_DiagRecs
641 Z_DiagRec **diagRecs;
644 typedef struct Z_NamePlusRecord
646 char *databaseName; /* OPTIONAL */
648 #define Z_NamePlusRecord_databaseRecord 0
649 #define Z_NamePlusRecord_surrogateDiagnostic 1
652 Z_DatabaseRecord *databaseRecord;
653 Z_DiagRec *surrogateDiagnostic;
657 typedef struct Z_NamePlusRecordList
660 Z_NamePlusRecord **records;
661 } Z_NamePlusRecordList;
663 typedef struct Z_Records
666 #define Z_Records_DBOSD 0
667 #define Z_Records_NSD 1
668 #define Z_Records_multipleNSD 2
671 Z_NamePlusRecordList *databaseOrSurDiagnostics;
672 Z_DiagRec *nonSurrogateDiagnostic;
673 Z_DiagRecs *multipleNonSurDiagnostics;
677 /* ------------------------ SEARCHRESPONSE ------------------ */
679 typedef struct Z_SearchResponse
681 Z_ReferenceId *referenceId; /* OPTIONAL */
683 int *numberOfRecordsReturned;
684 int *nextResultSetPosition;
685 bool_t *searchStatus;
686 int *resultSetStatus; /* OPTIONAL */
687 #define Z_RES_SUBSET 1
688 #define Z_RES_INTERIM 2
690 int *presentStatus; /* OPTIONAL */
691 #define Z_PRES_SUCCESS 0
692 #define Z_PRES_PARTIAL_1 1
693 #define Z_PRES_PARTIAL_2 2
694 #define Z_PRES_PARTIAL_3 3
695 #define Z_PRES_PARTIAL_4 4
696 #define Z_PRES_FAILURE 5
697 Z_Records *records; /* OPTIONAL */
699 Z_OtherInformation *additionalSearchInfo;
700 Z_OtherInformation *otherInfo;
704 /* ------------------------- PRESENT SERVICE -----------------*/
706 typedef struct Z_ElementSpec
709 #define Z_ElementSpec_elementSetName 0
710 #define Z_ElementSpec_externalSpec 1
713 char *elementSetName;
714 Z_External *externalSpec;
718 typedef struct Z_Specification
720 Odr_oid *schema; /* OPTIONAL */
721 Z_ElementSpec *elementSpec; /* OPTIONAL */
724 typedef struct Z_DbSpecific
727 Z_Specification *spec;
730 typedef struct Z_CompSpec
732 bool_t *selectAlternativeSyntax;
733 Z_Specification *generic; /* OPTIONAL */
735 Z_DbSpecific **dbSpecific; /* OPTIONAL */
736 int num_recordSyntax;
737 Odr_oid **recordSyntax; /* OPTIONAL */
740 typedef struct Z_RecordComposition
743 #define Z_RecordComp_simple 0
744 #define Z_RecordComp_complex 1
747 Z_ElementSetNames *simple;
750 } Z_RecordComposition;
752 typedef struct Z_Range
754 int *startingPosition;
755 int *numberOfRecords;
758 typedef struct Z_PresentRequest
760 Z_ReferenceId *referenceId; /* OPTIONAL */
761 Z_ResultSetId *resultSetId;
762 int *resultSetStartPoint;
763 int *numberOfRecordsRequested;
766 Z_Range **additionalRanges; /* OPTIONAL */
767 Z_RecordComposition *recordComposition; /* OPTIONAL */
769 Z_ElementSetNames *elementSetNames; /* OPTIONAL */
771 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
773 int *maxSegmentCount; /* OPTIONAL */
774 int *maxRecordSize; /* OPTIONAL */
775 int *maxSegmentSize; /* OPTIONAL */
776 Z_OtherInformation *otherInfo; /* OPTIONAL */
780 typedef struct Z_PresentResponse
782 Z_ReferenceId *referenceId; /* OPTIONAL */
783 int *numberOfRecordsReturned;
784 int *nextResultSetPosition;
788 Z_OtherInformation *otherInfo; /* OPTIONAL */
792 /* ------------------ RESOURCE CONTROL ----------------*/
794 typedef struct Z_TriggerResourceControlRequest
796 Z_ReferenceId *referenceId; /* OPTIONAL */
797 int *requestedAction;
798 #define Z_TriggerResourceCtrl_resourceReport 1
799 #define Z_TriggerResourceCtrl_resourceControl 2
800 #define Z_TriggerResourceCtrl_cancel 3
801 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
802 bool_t *resultSetWanted; /* OPTIONAL */
804 Z_OtherInformation *otherInfo;
806 } Z_TriggerResourceControlRequest;
808 typedef struct Z_ResourceControlRequest
810 Z_ReferenceId *referenceId; /* OPTIONAL */
811 bool_t *suspendedFlag; /* OPTIONAL */
812 Z_External *resourceReport; /* OPTIONAL */
813 int *partialResultsAvailable; /* OPTIONAL */
814 #define Z_ResourceControlRequest_subset 1
815 #define Z_ResourceControlRequest_interim 2
816 #define Z_ResourceControlRequest_none 3
817 bool_t *responseRequired;
818 bool_t *triggeredRequestFlag; /* OPTIONAL */
820 Z_OtherInformation *otherInfo;
822 } Z_ResourceControlRequest;
824 typedef struct Z_ResourceControlResponse
826 Z_ReferenceId *referenceId; /* OPTIONAL */
827 bool_t *continueFlag;
828 bool_t *resultSetWanted; /* OPTIONAL */
830 Z_OtherInformation *otherInfo;
832 } Z_ResourceControlResponse;
835 /* ------------------ ACCESS CTRL SERVICE ----------------*/
837 typedef struct Z_AccessControlRequest
839 Z_ReferenceId *referenceId; /* OPTIONAL */
841 #define Z_AccessRequest_simpleForm 0
842 #define Z_AccessRequest_externallyDefined 1
846 Z_External *externallyDefined;
849 Z_OtherInformation *otherInfo; /* OPTIONAL */
851 } Z_AccessControlRequest;
853 typedef struct Z_AccessControlResponse
855 Z_ReferenceId *referenceId; /* OPTIONAL */
857 #define Z_AccessResponse_simpleForm 0
858 #define Z_AccessResponse_externallyDefined 1
862 Z_External *externallyDefined;
864 Z_DiagRec *diagnostic; /* OPTIONAL */
866 Z_OtherInformation *otherInfo; /* OPTIONAL */
868 } Z_AccessControlResponse;
870 /* ------------------------ SCAN SERVICE -------------------- */
872 typedef struct Z_AttributeList
875 Z_AttributeElement **attributes;
878 typedef struct Z_AlternativeTerm
881 Z_AttributesPlusTerm **terms;
884 typedef struct Z_ByDatabase
887 int *num; /* OPTIONAL */
888 Z_OtherInformation *otherDbInfo; /* OPTIONAL */
891 typedef struct Z_ByDatabaseList
894 Z_ByDatabase **elements;
897 typedef struct Z_ScanOccurrences
900 #define Z_ScanOccurrences_global 0
901 #define Z_ScanOccurrences_byDatabase 1
905 Z_ByDatabaseList *byDatabase;
910 typedef struct Z_OccurrenceByAttributesElem
912 Z_AttributeList *attributes;
913 Z_ScanOccurrences *occurrences; /* OPTIONAL */
914 Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
915 } Z_OccurrenceByAttributesElem;
917 typedef struct Z_OccurrenceByAttributes
920 Z_OccurrenceByAttributesElem **elements;
921 } Z_OccurrenceByAttributes;
923 typedef struct Z_TermInfo
926 char *displayTerm; /* OPTIONAL */
927 Z_AttributeList *suggestedAttributes; /* OPTIONAL */
928 Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
929 int *globalOccurrences; /* OPTIONAL */
930 Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
931 Z_OtherInformation *otherTermInfo; /* OPTIONAL */
934 typedef struct Z_Entry
937 #define Z_Entry_termInfo 0
938 #define Z_Entry_surrogateDiagnostic 1
941 Z_TermInfo *termInfo;
942 Z_DiagRec *surrogateDiagnostic;
946 typedef struct Z_Entries
952 typedef struct Z_ListEntries
955 #define Z_ListEntries_entries 0
956 #define Z_ListEntries_nonSurrogateDiagnostics 1
960 Z_DiagRecs *nonSurrogateDiagnostics;
964 typedef struct Z_ScanRequest
966 Z_ReferenceId *referenceId; /* OPTIONAL */
967 int num_databaseNames;
968 char **databaseNames;
969 Odr_oid *attributeSet; /* OPTIONAL */
970 Z_AttributesPlusTerm *termListAndStartPoint;
971 int *stepSize; /* OPTIONAL */
972 int *numberOfTermsRequested;
973 int *preferredPositionInResponse; /* OPTIONAL */
975 Z_OtherInformation *otherInfo;
979 typedef struct Z_ScanResponse
981 Z_ReferenceId *referenceId; /* OPTIONAL */
982 int *stepSize; /* OPTIONAL */
984 #define Z_Scan_success 0
985 #define Z_Scan_partial_1 1
986 #define Z_Scan_partial_2 2
987 #define Z_Scan_partial_3 3
988 #define Z_Scan_partial_4 4
989 #define Z_Scan_partial_5 5
990 #define Z_Scan_failure 6
991 int *numberOfEntriesReturned;
992 int *positionOfTerm; /* OPTIONAL */
993 Z_ListEntries *entries; /* OPTIONAL */
994 Odr_oid *attributeSet; /* OPTIONAL */
996 Z_OtherInformation *otherInfo;
1001 /* ------------------------ DELETE -------------------------- */
1003 #define Z_DeleteStatus_success 0
1004 #define Z_DeleteStatus_resultSetDidNotExist 1
1005 #define Z_DeleteStatus_previouslyDeletedByTarget 2
1006 #define Z_DeleteStatus_systemProblemAtTarget 3
1007 #define Z_DeleteStatus_accessNotAllowed 4
1008 #define Z_DeleteStatus_resourceControlAtOrigin 5
1009 #define Z_DeleteStatus_resourceControlAtTarget 6
1010 #define Z_DeleteStatus_bulkDeleteNotSupported 7
1011 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
1012 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
1013 #define Z_DeleteStatus_resultSetInUse 10
1015 typedef struct Z_ListStatus
1021 typedef struct Z_DeleteResultSetRequest
1023 Z_ReferenceId *referenceId; /* OPTIONAL */
1024 int *deleteFunction;
1025 #define Z_DeleteRequest_list 0
1026 #define Z_DeleteRequest_all 1
1028 Z_ResultSetId **resultSetList; /* OPTIONAL */
1030 Z_OtherInformation *otherInfo;
1032 } Z_DeleteResultSetRequest;
1034 typedef struct Z_DeleteResultSetResponse
1036 Z_ReferenceId *referenceId; /* OPTIONAL */
1037 int *deleteOperationStatus;
1039 Z_ListStatus **deleteListStatuses; /* OPTIONAL */
1040 int *numberNotDeleted; /* OPTIONAL */
1041 int num_bulkStatuses;
1042 Z_ListStatus **bulkStatuses; /* OPTIONAL */
1043 char *deleteMessage; /* OPTIONAL */
1045 Z_OtherInformation *otherInfo;
1047 } Z_DeleteResultSetResponse;
1049 /* ------------------------ CLOSE SERVICE ------------------- */
1051 typedef struct Z_Close
1053 Z_ReferenceId *referenceId; /* OPTIONAL */
1055 #define Z_Close_finished 0
1056 #define Z_Close_shutdown 1
1057 #define Z_Close_systemProblem 2
1058 #define Z_Close_costLimit 3
1059 #define Z_Close_resources 4
1060 #define Z_Close_securityViolation 5
1061 #define Z_Close_protocolError 6
1062 #define Z_Close_lackOfActivity 7
1063 #define Z_Close_peerAbort 8
1064 #define Z_Close_unspecified 9
1065 char *diagnosticInformation; /* OPTIONAL */
1066 Odr_oid *resourceReportFormat; /* OPTIONAL */
1067 Z_External *resourceReport; /* OPTIONAL */
1069 Z_OtherInformation *otherInfo; /* OPTIONAL */
1073 /* ------------------------ SEGMENTATION -------------------- */
1075 typedef struct Z_Segment
1077 Z_ReferenceId *referenceId; /* OPTIONAL */
1078 int *numberOfRecordsReturned;
1079 int num_segmentRecords;
1080 Z_NamePlusRecord **segmentRecords;
1081 Z_OtherInformation *otherInfo; /* OPTIONAL */
1084 /* ----------------------- Extended Services ---------------- */
1086 typedef struct Z_Permissions
1089 int num_allowableFunctions;
1090 int **allowableFunctions;
1091 #define Z_Permissions_delete 1
1092 #define Z_Permissions_modifyContents 2
1093 #define Z_Permissions_modifyPermissions 3
1094 #define Z_Permissions_present 4
1095 #define Z_Permissions_invoke 5
1098 typedef struct Z_ExtendedServicesRequest
1100 Z_ReferenceId *referenceId; /* OPTIONAL */
1102 #define Z_ExtendedServicesRequest_create 1
1103 #define Z_ExtendedServicesRequest_delete 2
1104 #define Z_ExtendedServicesRequest_modify 3
1105 Odr_oid *packageType;
1106 char *packageName; /* OPTIONAL */
1107 char *userId; /* OPTIONAL */
1108 Z_IntUnit *retentionTime; /* OPTIONAL */
1109 Z_Permissions *permissions; /* OPTIONAL */
1110 char *description; /* OPTIONAL */
1111 Z_External *taskSpecificParameters; /* OPTIONAL */
1113 #define Z_ExtendedServicesRequest_wait 1
1114 #define Z_ExtendedServicesRequest_waitIfPossible 2
1115 #define Z_ExtendedServicesRequest_dontWait 3
1116 #define Z_ExtendedServicesRequest_dontReturnPackage 4
1117 char *elements; /* OPTIONAL */
1118 Z_OtherInformation *otherInfo; /* OPTIONAL */
1119 } Z_ExtendedServicesRequest;
1121 typedef struct Z_ExtendedServicesResponse
1123 Z_ReferenceId *referenceId; /* OPTIONAL */
1124 int *operationStatus;
1125 #define Z_ExtendedServicesResponse_done 1
1126 #define Z_ExtendedServicesResponse_accepted 2
1127 #define Z_ExtendedServicesResponse_failure 3
1128 int num_diagnostics;
1129 Z_DiagRec **diagnostics; /* OPTIONAL */
1130 Z_External *taskPackage; /* OPTIONAL */
1131 Z_OtherInformation *otherInfo; /* OPTIONAL */
1132 } Z_ExtendedServicesResponse;
1134 /* ------------------------ Sort --------------------------- */
1136 typedef struct Z_SortAttributes
1139 Z_AttributeList *list;
1142 typedef struct Z_SortKey
1145 #define Z_SortKey_sortField 0
1146 #define Z_SortKey_elementSpec 1
1147 #define Z_SortKey_sortAttributes 2
1151 Z_Specification *elementSpec;
1152 Z_SortAttributes *sortAttributes;
1156 typedef struct Z_SortDbSpecific
1162 typedef struct Z_SortDbSpecificList
1165 Z_SortDbSpecific **dbSpecific;
1166 } Z_SortDbSpecificList;
1168 typedef struct Z_SortElement
1171 #define Z_SortElement_generic 0
1172 #define Z_SortElement_databaseSpecific 1
1176 Z_SortDbSpecificList *databaseSpecific;
1180 typedef struct Z_SortMissingValueAction
1183 #define Z_SortMissingValAct_abort 0
1184 #define Z_SortMissingValAct_null 1
1185 #define Z_SortMissingValAct_valData 2
1192 } Z_SortMissingValueAction;
1194 typedef struct Z_SortKeySpec
1196 Z_SortElement *sortElement;
1198 #define Z_SortRelation_ascending 0
1199 #define Z_SortRelation_descending 1
1200 #define Z_SortRelation_ascendingByFreq 3
1201 #define Z_SortRelation_descendingByFreq 4
1202 int *caseSensitivity;
1203 #define Z_SortCase_caseSensitive 0
1204 #define Z_SortCase_caseInsensitive 1
1205 Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
1208 typedef struct Z_SortResponse
1210 Z_ReferenceId *referenceId; /* OPTIONAL */
1212 #define Z_SortStatus_success 0
1213 #define Z_SortStatus_partial_1 1
1214 #define Z_SortStatus_failure 2
1215 int *resultSetStatus; /* OPTIONAL */
1216 #define Z_SortResultSetStatus_empty 1
1217 #define Z_SortResultSetStatus_interim 2
1218 #define Z_SortResultSetStatus_unchanged 3
1219 #define Z_SortResultSetStatus_none 4
1220 Z_DiagRecs *diagnostics; /* OPTIONAL */
1221 Z_OtherInformation *otherInfo; /* OPTIONAL */
1224 typedef struct Z_SortKeySpecList
1227 Z_SortKeySpec **specs;
1228 } Z_SortKeySpecList;
1230 typedef struct Z_SortRequest
1232 Z_ReferenceId *referenceId; /* OPTIONAL */
1233 Z_StringList *inputResultSetNames;
1234 char *sortedResultSetName;
1235 Z_SortKeySpecList *sortSequence;
1236 Z_OtherInformation *otherInfo; /* OPTIONAL */
1239 /* ----------------------- Resource Report ------------------ */
1241 typedef struct Z_ResourceReportRequest
1243 Z_ReferenceId *referenceId; /* OPTIONAL */
1244 Z_ReferenceId *opId; /* OPTIONAL */
1245 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
1246 Z_OtherInformation *otherInfo; /* OPTIONAL */
1247 } Z_ResourceReportRequest;
1249 typedef struct Z_ResourceReportResponse
1251 Z_ReferenceId *referenceId; /* OPTIONAL */
1252 int *resourceReportStatus;
1253 #define Z_ResourceReportStatus_success 0
1254 #define Z_ResourceReportStatus_partial 1
1255 #define Z_ResourceReportStatus_failure_1 2
1256 #define Z_ResourceReportStatus_failure_2 3
1257 #define Z_ResourceReportStatus_failure_3 4
1258 #define Z_ResourceReportStatus_failure_4 5
1259 #define Z_ResourceReportStatus_failure_5 6
1260 #define Z_ResourceReportStatus_failure_6 7
1261 Z_External *resourceReport; /* OPTIONAL */
1262 Z_OtherInformation *otherInfo; /* OPTIONAL */
1263 } Z_ResourceReportResponse;
1265 /* ------------------------ APDU ---------------------------- */
1267 typedef struct Z_APDU
1270 #define Z_APDU_initRequest 0
1271 #define Z_APDU_initResponse 1
1272 #define Z_APDU_searchRequest 2
1273 #define Z_APDU_searchResponse 3
1274 #define Z_APDU_presentRequest 4
1275 #define Z_APDU_presentResponse 5
1276 #define Z_APDU_deleteResultSetRequest 6
1277 #define Z_APDU_deleteResultSetResponse 7
1278 #define Z_APDU_resourceControlRequest 8
1279 #define Z_APDU_resourceControlResponse 9
1280 #define Z_APDU_triggerResourceControlRequest 10
1281 #define Z_APDU_scanRequest 11
1282 #define Z_APDU_scanResponse 12
1283 #define Z_APDU_segmentRequest 13
1284 #define Z_APDU_extendedServicesRequest 14
1285 #define Z_APDU_extendedServicesResponse 15
1286 #define Z_APDU_close 16
1287 #define Z_APDU_accessControlRequest 17
1288 #define Z_APDU_accessControlResponse 18
1289 #define Z_APDU_sortRequest 20
1290 #define Z_APDU_sortResponse 21
1291 #define Z_APDU_resourceReportRequest 22
1292 #define Z_APDU_resourceReportResponse 23
1295 Z_InitRequest *initRequest;
1296 Z_InitResponse *initResponse;
1297 Z_SearchRequest *searchRequest;
1298 Z_SearchResponse *searchResponse;
1299 Z_PresentRequest *presentRequest;
1300 Z_PresentResponse *presentResponse;
1301 Z_DeleteResultSetRequest *deleteResultSetRequest;
1302 Z_DeleteResultSetResponse *deleteResultSetResponse;
1303 Z_AccessControlRequest *accessControlRequest;
1304 Z_AccessControlResponse *accessControlResponse;
1305 Z_ResourceControlRequest *resourceControlRequest;
1306 Z_ResourceControlResponse *resourceControlResponse;
1307 Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1308 Z_ResourceReportRequest *resourceReportRequest;
1309 Z_ResourceReportResponse *resourceReportResponse;
1310 Z_ScanRequest *scanRequest;
1311 Z_ScanResponse *scanResponse;
1312 Z_SortRequest *sortRequest;
1313 Z_SortResponse *sortResponse;
1314 Z_Segment *segmentRequest;
1315 Z_ExtendedServicesRequest *extendedServicesRequest;
1316 Z_ExtendedServicesResponse *extendedServicesResponse;
1321 YAZ_EXPORT int z_APDU(ODR o, Z_APDU **p, int opt);
1322 YAZ_EXPORT int z_SUTRS(ODR o, Odr_oct **p, int opt);
1324 YAZ_EXPORT Z_InitRequest *zget_InitRequest(ODR o);
1325 YAZ_EXPORT Z_InitResponse *zget_InitResponse(ODR o);
1326 YAZ_EXPORT Z_SearchRequest *zget_SearchRequest(ODR o);
1327 YAZ_EXPORT Z_SearchResponse *zget_SearchResponse(ODR o);
1328 YAZ_EXPORT Z_PresentRequest *zget_PresentRequest(ODR o);
1329 YAZ_EXPORT Z_PresentResponse *zget_PresentResponse(ODR o);
1330 YAZ_EXPORT Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1331 YAZ_EXPORT Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1332 YAZ_EXPORT Z_ScanRequest *zget_ScanRequest(ODR o);
1333 YAZ_EXPORT Z_ScanResponse *zget_ScanResponse(ODR o);
1334 YAZ_EXPORT Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1335 YAZ_EXPORT Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1336 YAZ_EXPORT Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1337 YAZ_EXPORT Z_Close *zget_Close(ODR o);
1338 YAZ_EXPORT int z_StringList(ODR o, Z_StringList **p, int opt);
1339 YAZ_EXPORT int z_InternationalString(ODR o, char **p, int opt);
1340 YAZ_EXPORT int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt);
1341 YAZ_EXPORT int z_ElementSetName(ODR o, char **p, int opt);
1342 YAZ_EXPORT int z_IntUnit(ODR o, Z_IntUnit **p, int opt);
1343 YAZ_EXPORT int z_Unit(ODR o, Z_Unit **p, int opt);
1344 YAZ_EXPORT int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt);
1345 YAZ_EXPORT int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt);
1346 YAZ_EXPORT int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt);
1347 YAZ_EXPORT int z_Term(ODR o, Z_Term **p, int opt);
1348 YAZ_EXPORT int z_Specification(ODR o, Z_Specification **p, int opt);
1349 YAZ_EXPORT int z_Permissions(ODR o, Z_Permissions **p, int opt);
1350 YAZ_EXPORT int z_DiagRec(ODR o, Z_DiagRec **p, int opt);
1351 YAZ_EXPORT int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt);
1352 YAZ_EXPORT int z_AttributeList(ODR o, Z_AttributeList **p, int opt);
1353 YAZ_EXPORT int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt);
1354 YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which);
1355 YAZ_EXPORT int z_Query(ODR o, Z_Query **p, int opt);
1361 #include <prt-rsc.h>
1362 #include <prt-acc.h>
1363 #include <prt-exp.h>
1364 #include <prt-grs.h>
1365 #include <prt-arc.h>
1366 #include <prt-exd.h>
1367 #include <prt-dia.h>
1368 #include <prt-esp.h>
1369 #include <prt-add.h>
1371 #include <prt-dat.h>
1372 #include <prt-univ.h>
1373 #include <prt-ext.h>