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.45 1998-08-19 16:10:07 adam
28 * Changed som member names of DeleteResultSetRequest/Response.
30 * Revision 1.44 1998/05/18 10:14:08 adam
31 * Minor change - removed 'dead' definitions.
33 * Revision 1.43 1998/03/31 11:07:45 adam
34 * Furhter work on UNIverse resource report.
35 * Added Extended Services handling in frontend server.
37 * Revision 1.42 1998/03/20 14:46:06 adam
38 * Added UNIverse Resource Reports.
40 * Revision 1.41 1998/02/10 15:31:52 adam
41 * Implemented date and time structure. Changed the Update Extended
44 * Revision 1.40 1997/09/01 08:49:50 adam
45 * New windows NT/95 port using MSV5.0. To export DLL functions the
46 * YAZ_EXPORT modifier was added. Defined in yconfig.h.
48 * Revision 1.39 1997/05/14 06:53:44 adam
51 * Revision 1.38 1997/04/30 08:52:09 quinn
54 * Revision 1.37 1996/10/09 15:54:58 quinn
55 * Added SearchInfoReport
57 * Revision 1.36 1996/10/07 15:29:20 quinn
60 * Revision 1.35 1996/06/10 08:57:38 quinn
61 * Added OPAC, ResourceReport
63 * Revision 1.34 1996/06/10 08:55:36 quinn
66 * Revision 1.33 1996/02/23 10:00:51 quinn
69 * Revision 1.32 1996/02/20 12:52:39 quinn
72 * Revision 1.31 1996/01/22 09:46:45 quinn
73 * Added Sort PDU. Moved StringList to main protocol file.
75 * Revision 1.30 1996/01/10 15:21:32 quinn
76 * Added links to access control PDUs
78 * Revision 1.29 1996/01/02 11:46:49 quinn
79 * Changed 'operator' to 'roperator' to avoid C++ conflict.
82 * Revision 1.28 1996/01/02 08:57:32 quinn
83 * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
85 * Revision 1.27 1995/10/12 10:34:46 quinn
88 * Revision 1.26 1995/09/29 17:12:08 quinn
91 * Revision 1.25 1995/09/27 15:02:49 quinn
92 * Modified function heads & prototypes.
94 * Revision 1.24 1995/08/29 11:17:43 quinn
95 * *** empty log message ***
97 * Revision 1.23 1995/08/21 09:10:36 quinn
98 * Smallish fixes to suppport new formats.
100 * Revision 1.22 1995/08/17 12:45:14 quinn
101 * Fixed minor problems with GRS-1. Added support in c&s.
103 * Revision 1.21 1995/08/15 12:00:11 quinn
106 * Revision 1.20 1995/08/10 08:54:35 quinn
109 * Revision 1.19 1995/06/19 12:38:28 quinn
110 * Reorganized include-files. Added small features.
112 * Revision 1.18 1995/06/16 13:16:05 quinn
113 * Fixed Defaultdiagformat.
115 * Revision 1.17 1995/06/15 15:42:05 quinn
118 * Revision 1.16 1995/06/15 07:45:06 quinn
121 * Revision 1.15 1995/06/14 15:26:43 quinn
122 * *** empty log message ***
124 * Revision 1.14 1995/06/07 14:42:34 quinn
127 * Revision 1.13 1995/06/07 14:36:47 quinn
130 * Revision 1.12 1995/06/05 10:53:13 quinn
133 * Revision 1.11 1995/06/02 09:49:47 quinn
136 * Revision 1.10 1995/05/29 08:11:34 quinn
137 * Moved oid from odr/asn to util.
139 * Revision 1.9 1995/05/22 11:31:25 quinn
142 * Revision 1.8 1995/05/17 08:41:35 quinn
143 * Added delete to proto & other little things.
144 * Relaying auth info to backend.
146 * Revision 1.7 1995/05/16 08:50:37 quinn
147 * License, documentation, and memory fixes
149 * Revision 1.6 1995/05/15 11:55:55 quinn
150 * Work on asynchronous activity.
152 * Revision 1.5 1995/04/17 11:28:18 quinn
155 * Revision 1.4 1995/04/10 10:22:47 quinn
158 * Revision 1.3 1995/03/30 12:18:09 quinn
161 * Revision 1.2 1995/03/30 10:26:48 quinn
162 * Added Term structure
164 * Revision 1.1 1995/03/30 09:39:42 quinn
165 * Moved .h files to include directory
167 * Revision 1.11 1995/03/30 09:08:44 quinn
168 * Added Resource control protocol
170 * Revision 1.10 1995/03/29 15:39:39 quinn
171 * Adding some resource control elements, and a null-check to getentbyoid
173 * Revision 1.9 1995/03/29 08:06:18 quinn
174 * Added a few v3 elements
176 * Revision 1.8 1995/03/22 10:12:49 quinn
177 * Added Z_PRES constants.
179 * Revision 1.7 1995/03/20 09:45:12 quinn
182 * Revision 1.5 1995/03/07 16:29:34 quinn
183 * Added authentication stuff.
185 * Revision 1.4 1995/03/07 10:13:00 quinn
186 * Added prototype for z_APDU()
188 * Revision 1.3 1995/02/14 11:54:23 quinn
191 * Revision 1.2 1995/02/09 15:51:40 quinn
194 * Revision 1.1 1995/02/06 16:44:48 quinn
195 * First hack at Z/SR protocol
206 #include <yaz-version.h>
213 * Because we didn't have time to put all of the extra v3 elements in here
214 * before the first applications were written, we have to place them
215 * in #ifdefs in places where they would break existing code. If you are
216 * developing new stuff, we urge you to leave them in, even if you don't
217 * intend to use any v3 features. When we are comfortable that the old
218 * apps have been updated, we'll remove the #ifdefs.
223 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
226 typedef struct Z_External Z_External;
228 typedef Odr_oct Z_ReferenceId;
229 typedef char Z_DatabaseName;
230 typedef char Z_ResultSetId;
231 typedef Odr_oct Z_ResultsetId;
233 typedef struct Z_InfoCategory
235 Odr_oid *categoryTypeId; /* OPTIONAL */
239 typedef struct Z_OtherInformationUnit
241 Z_InfoCategory *category; /* OPTIONAL */
243 #define Z_OtherInfo_characterInfo 0
244 #define Z_OtherInfo_binaryInfo 1
245 #define Z_OtherInfo_externallyDefinedInfo 2
246 #define Z_OtherInfo_oid 3
251 Z_External *externallyDefinedInfo;
254 } Z_OtherInformationUnit;
256 typedef struct Z_OtherInformation
259 Z_OtherInformationUnit **list;
260 } Z_OtherInformation;
262 typedef struct Z_StringOrNumeric
265 #define Z_StringOrNumeric_string 0
266 #define Z_StringOrNumeric_numeric 1
274 typedef struct Z_Unit
276 char *unitSystem; /* OPTIONAL */
277 Z_StringOrNumeric *unitType; /* OPTIONAL */
278 Z_StringOrNumeric *unit; /* OPTIONAL */
279 int *scaleFactor; /* OPTIONAL */
282 typedef struct Z_IntUnit
288 typedef Odr_oct Z_SUTRS;
290 typedef struct Z_StringList
296 /* ----------------- INIT SERVICE ----------------*/
300 char *groupId; /* OPTIONAL */
301 char *userId; /* OPTIONAL */
302 char *password; /* OPTIONAL */
305 typedef struct Z_IdAuthentication
308 #define Z_IdAuthentication_open 0
309 #define Z_IdAuthentication_idPass 1
310 #define Z_IdAuthentication_anonymous 2
311 #define Z_IdAuthentication_other 3
319 } Z_IdAuthentication;
321 #define Z_ProtocolVersion_1 0
322 #define Z_ProtocolVersion_2 1
323 #define Z_ProtocolVersion_3 2
325 #define Z_Options_search 0
326 #define Z_Options_present 1
327 #define Z_Options_delSet 2
328 #define Z_Options_resourceReport 3
329 #define Z_Options_triggerResourceCtrl 4
330 #define Z_Options_resourceCtrl 5
331 #define Z_Options_accessCtrl 6
332 #define Z_Options_scan 7
333 #define Z_Options_sort 8
334 #define Z_Options_reserved 9
335 #define Z_Options_extendedServices 10
336 #define Z_Options_level_1Segmentation 11
337 #define Z_Options_level_2Segmentation 12
338 #define Z_Options_concurrentOperations 13
339 #define Z_Options_namedResultSets 14
341 typedef struct Z_InitRequest
343 Z_ReferenceId *referenceId; /* OPTIONAL */
344 Odr_bitmask *protocolVersion;
345 Odr_bitmask *options;
346 int *preferredMessageSize;
347 int *maximumRecordSize;
348 Z_IdAuthentication* idAuthentication; /* OPTIONAL */
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_InitResponse
360 Z_ReferenceId *referenceId; /* OPTIONAL */
361 Odr_bitmask *protocolVersion;
362 Odr_bitmask *options;
363 int *preferredMessageSize;
364 int *maximumRecordSize;
366 char *implementationId; /* OPTIONAL */
367 char *implementationName; /* OPTIONAL */
368 char *implementationVersion; /* OPTIONAL */
369 Z_External *userInformationField; /* OPTIONAL */
371 Z_OtherInformation *otherInfo; /* OPTIONAL */
375 typedef struct Z_NSRAuthentication
380 } Z_NSRAuthentication;
382 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
384 int z_StrAuthentication(ODR o, char **p, int opt);
386 /* ------------------ SEARCH SERVICE ----------------*/
388 typedef struct Z_DatabaseSpecificUnit
391 char *elementSetName;
392 } Z_DatabaseSpecificUnit;
394 typedef struct Z_DatabaseSpecific
397 Z_DatabaseSpecificUnit **elements;
398 } Z_DatabaseSpecific;
400 typedef struct Z_ElementSetNames
403 #define Z_ElementSetNames_generic 0
404 #define Z_ElementSetNames_databaseSpecific 1
408 Z_DatabaseSpecific *databaseSpecific;
412 /* ---------------------- RPN QUERY --------------------------- */
414 typedef struct Z_ComplexAttribute
417 Z_StringOrNumeric **list;
418 int num_semanticAction;
419 int **semanticAction; /* OPTIONAL */
420 } Z_ComplexAttribute;
422 typedef struct Z_AttributeElement
425 Odr_oid *attributeSet; /* OPTIONAL - v3 only */
430 #define Z_AttributeValue_numeric 0
431 #define Z_AttributeValue_complex 1
435 Z_ComplexAttribute *complex;
440 } Z_AttributeElement;
442 typedef struct Z_Term
445 #define Z_Term_general 0
446 #define Z_Term_numeric 1
447 #define Z_Term_characterString 2
449 #define Z_Term_dateTime 4
450 #define Z_Term_external 5
451 #define Z_Term_integerAndUnit 6
452 #define Z_Term_null 7
455 Odr_oct *general; /* this is required for v2 */
457 char *characterString;
460 Z_External *external;
461 /* Z_IntUnit *integerAndUnit; */
466 typedef struct Z_AttributesPlusTerm
469 Z_AttributeElement **attributeList;
471 } Z_AttributesPlusTerm;
473 typedef struct Z_ResultSetPlusAttributes
477 Z_AttributeElement **attributeList;
478 } Z_ResultSetPlusAttributes;
480 typedef struct Z_ProximityOperator
482 bool_t *exclusion; /* OPTIONAL */
486 #define Z_Prox_lessThan 1
487 #define Z_Prox_lessThanOrEqual 2
488 #define Z_Prox_equal 3
489 #define Z_Prox_greaterThanOrEqual 4
490 #define Z_Prox_greaterThan 5
491 #define Z_Prox_notEqual 6
493 #define Z_ProxCode_known 0
494 #define Z_ProxCode_private 1
495 int *proximityUnitCode;
496 #define Z_ProxUnit_character 1
497 #define Z_ProxUnit_word 2
498 #define Z_ProxUnit_sentence 3
499 #define Z_ProxUnit_paragraph 4
500 #define Z_ProxUnit_section 5
501 #define Z_ProxUnit_chapter 6
502 #define Z_ProxUnit_document 7
503 #define Z_ProxUnit_element 8
504 #define Z_ProxUnit_subelement 9
505 #define Z_ProxUnit_elementType 10
506 #define Z_ProxUnit_byte 11 /* v3 only */
507 } Z_ProximityOperator;
509 typedef struct Z_Operator
512 #define Z_Operator_and 0
513 #define Z_Operator_or 1
514 #define Z_Operator_and_not 2
515 #define Z_Operator_prox 3
518 Odr_null *and; /* these guys are nulls. */
521 Z_ProximityOperator *prox;
525 typedef struct Z_Operand
528 #define Z_Operand_APT 0
529 #define Z_Operand_resultSetId 1
530 #define Z_Operand_resultAttr /* v3 only */ 2
533 Z_AttributesPlusTerm *attributesPlusTerm;
534 Z_ResultSetId *resultSetId;
535 Z_ResultSetPlusAttributes *resultAttr;
539 typedef struct Z_Complex
541 struct Z_RPNStructure *s1;
542 struct Z_RPNStructure *s2;
543 Z_Operator *roperator;
546 typedef struct Z_RPNStructure
549 #define Z_RPNStructure_simple 0
550 #define Z_RPNStructure_complex 1
558 typedef struct Z_RPNQuery
560 Odr_oid *attributeSetId;
561 Z_RPNStructure *RPNStructure;
564 /* -------------------------- SEARCHREQUEST -------------------------- */
566 typedef struct Z_Query
569 #define Z_Query_type_1 1
570 #define Z_Query_type_2 2
571 #define Z_Query_type_101 3
576 Z_RPNQuery *type_101;
580 typedef struct Z_SearchRequest
582 Z_ReferenceId *referenceId; /* OPTIONAL */
583 int *smallSetUpperBound;
584 int *largeSetLowerBound;
585 int *mediumSetPresentNumber;
586 bool_t *replaceIndicator;
588 int num_databaseNames;
589 char **databaseNames;
590 Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */
591 Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */
592 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
595 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */
596 Z_OtherInformation *otherInfo; /* OPTIONAL */
600 /* ------------------------ RECORD -------------------------- */
602 typedef Z_External Z_DatabaseRecord;
606 typedef struct Z_DefaultDiagFormat
608 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
610 /* until the whole character set issue becomes more definite,
611 * you can probably ignore this on input. */
613 #define Z_DiagForm_v2AddInfo 0
614 #define Z_DiagForm_v3AddInfo 1
616 } Z_DefaultDiagFormat;
618 typedef struct Z_DiagRec
621 #define Z_DiagRec_defaultFormat 0
622 #define Z_DiagRec_externallyDefined 1
625 Z_DefaultDiagFormat *defaultFormat;
626 Z_External *externallyDefined;
632 typedef struct Z_DiagRec
634 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
641 typedef struct Z_DiagRecs
644 Z_DiagRec **diagRecs;
647 typedef struct Z_NamePlusRecord
649 char *databaseName; /* OPTIONAL */
651 #define Z_NamePlusRecord_databaseRecord 0
652 #define Z_NamePlusRecord_surrogateDiagnostic 1
655 Z_DatabaseRecord *databaseRecord;
656 Z_DiagRec *surrogateDiagnostic;
660 typedef struct Z_NamePlusRecordList
663 Z_NamePlusRecord **records;
664 } Z_NamePlusRecordList;
666 typedef struct Z_Records
669 #define Z_Records_DBOSD 0
670 #define Z_Records_NSD 1
671 #define Z_Records_multipleNSD 2
674 Z_NamePlusRecordList *databaseOrSurDiagnostics;
675 Z_DiagRec *nonSurrogateDiagnostic;
676 Z_DiagRecs *multipleNonSurDiagnostics;
680 /* ------------------------ SEARCHRESPONSE ------------------ */
682 typedef struct Z_SearchResponse
684 Z_ReferenceId *referenceId; /* OPTIONAL */
686 int *numberOfRecordsReturned;
687 int *nextResultSetPosition;
688 bool_t *searchStatus;
689 int *resultSetStatus; /* OPTIONAL */
690 #define Z_RES_SUBSET 1
691 #define Z_RES_INTERIM 2
693 int *presentStatus; /* OPTIONAL */
694 #define Z_PRES_SUCCESS 0
695 #define Z_PRES_PARTIAL_1 1
696 #define Z_PRES_PARTIAL_2 2
697 #define Z_PRES_PARTIAL_3 3
698 #define Z_PRES_PARTIAL_4 4
699 #define Z_PRES_FAILURE 5
700 Z_Records *records; /* OPTIONAL */
702 Z_OtherInformation *additionalSearchInfo;
703 Z_OtherInformation *otherInfo;
707 /* ------------------------- PRESENT SERVICE -----------------*/
709 typedef struct Z_ElementSpec
712 #define Z_ElementSpec_elementSetName 0
713 #define Z_ElementSpec_externalSpec 1
716 char *elementSetName;
717 Z_External *externalSpec;
721 typedef struct Z_Specification
723 Odr_oid *schema; /* OPTIONAL */
724 Z_ElementSpec *elementSpec; /* OPTIONAL */
727 typedef struct Z_DbSpecific
730 Z_Specification *spec;
733 typedef struct Z_CompSpec
735 bool_t *selectAlternativeSyntax;
736 Z_Specification *generic; /* OPTIONAL */
738 Z_DbSpecific **dbSpecific; /* OPTIONAL */
739 int num_recordSyntax;
740 Odr_oid **recordSyntax; /* OPTIONAL */
743 typedef struct Z_RecordComposition
746 #define Z_RecordComp_simple 0
747 #define Z_RecordComp_complex 1
750 Z_ElementSetNames *simple;
753 } Z_RecordComposition;
755 typedef struct Z_Range
757 int *startingPosition;
758 int *numberOfRecords;
761 typedef struct Z_PresentRequest
763 Z_ReferenceId *referenceId; /* OPTIONAL */
764 Z_ResultSetId *resultSetId;
765 int *resultSetStartPoint;
766 int *numberOfRecordsRequested;
769 Z_Range **additionalRanges; /* OPTIONAL */
770 Z_RecordComposition *recordComposition; /* OPTIONAL */
772 Z_ElementSetNames *elementSetNames; /* OPTIONAL */
774 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
776 int *maxSegmentCount; /* OPTIONAL */
777 int *maxRecordSize; /* OPTIONAL */
778 int *maxSegmentSize; /* OPTIONAL */
779 Z_OtherInformation *otherInfo; /* OPTIONAL */
783 typedef struct Z_PresentResponse
785 Z_ReferenceId *referenceId; /* OPTIONAL */
786 int *numberOfRecordsReturned;
787 int *nextResultSetPosition;
791 Z_OtherInformation *otherInfo; /* OPTIONAL */
795 /* ------------------ RESOURCE CONTROL ----------------*/
797 typedef struct Z_TriggerResourceControlRequest
799 Z_ReferenceId *referenceId; /* OPTIONAL */
800 int *requestedAction;
801 #define Z_TriggerResourceCtrl_resourceReport 1
802 #define Z_TriggerResourceCtrl_resourceControl 2
803 #define Z_TriggerResourceCtrl_cancel 3
804 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
805 bool_t *resultSetWanted; /* OPTIONAL */
807 Z_OtherInformation *otherInfo;
809 } Z_TriggerResourceControlRequest;
811 typedef struct Z_ResourceControlRequest
813 Z_ReferenceId *referenceId; /* OPTIONAL */
814 bool_t *suspendedFlag; /* OPTIONAL */
815 Z_External *resourceReport; /* OPTIONAL */
816 int *partialResultsAvailable; /* OPTIONAL */
817 #define Z_ResourceControlRequest_subset 1
818 #define Z_ResourceControlRequest_interim 2
819 #define Z_ResourceControlRequest_none 3
820 bool_t *responseRequired;
821 bool_t *triggeredRequestFlag; /* OPTIONAL */
823 Z_OtherInformation *otherInfo;
825 } Z_ResourceControlRequest;
827 typedef struct Z_ResourceControlResponse
829 Z_ReferenceId *referenceId; /* OPTIONAL */
830 bool_t *continueFlag;
831 bool_t *resultSetWanted; /* OPTIONAL */
833 Z_OtherInformation *otherInfo;
835 } Z_ResourceControlResponse;
838 /* ------------------ ACCESS CTRL SERVICE ----------------*/
840 typedef struct Z_AccessControlRequest
842 Z_ReferenceId *referenceId; /* OPTIONAL */
844 #define Z_AccessRequest_simpleForm 0
845 #define Z_AccessRequest_externallyDefined 1
849 Z_External *externallyDefined;
852 Z_OtherInformation *otherInfo; /* OPTIONAL */
854 } Z_AccessControlRequest;
856 typedef struct Z_AccessControlResponse
858 Z_ReferenceId *referenceId; /* OPTIONAL */
860 #define Z_AccessResponse_simpleForm 0
861 #define Z_AccessResponse_externallyDefined 1
865 Z_External *externallyDefined;
867 Z_DiagRec *diagnostic; /* OPTIONAL */
869 Z_OtherInformation *otherInfo; /* OPTIONAL */
871 } Z_AccessControlResponse;
873 /* ------------------------ SCAN SERVICE -------------------- */
875 typedef struct Z_AttributeList
878 Z_AttributeElement **attributes;
881 typedef struct Z_AlternativeTerm
884 Z_AttributesPlusTerm **terms;
887 typedef struct Z_ByDatabase
890 int *num; /* OPTIONAL */
891 Z_OtherInformation *otherDbInfo; /* OPTIONAL */
894 typedef struct Z_ByDatabaseList
897 Z_ByDatabase **elements;
900 typedef struct Z_ScanOccurrences
903 #define Z_ScanOccurrences_global 0
904 #define Z_ScanOccurrences_byDatabase 1
908 Z_ByDatabaseList *byDatabase;
913 typedef struct Z_OccurrenceByAttributesElem
915 Z_AttributeList *attributes;
916 Z_ScanOccurrences *occurrences; /* OPTIONAL */
917 Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
918 } Z_OccurrenceByAttributesElem;
920 typedef struct Z_OccurrenceByAttributes
923 Z_OccurrenceByAttributesElem **elements;
924 } Z_OccurrenceByAttributes;
926 typedef struct Z_TermInfo
929 char *displayTerm; /* OPTIONAL */
930 Z_AttributeList *suggestedAttributes; /* OPTIONAL */
931 Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
932 int *globalOccurrences; /* OPTIONAL */
933 Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
934 Z_OtherInformation *otherTermInfo; /* OPTIONAL */
937 typedef struct Z_Entry
940 #define Z_Entry_termInfo 0
941 #define Z_Entry_surrogateDiagnostic 1
944 Z_TermInfo *termInfo;
945 Z_DiagRec *surrogateDiagnostic;
949 typedef struct Z_Entries
955 typedef struct Z_ListEntries
958 #define Z_ListEntries_entries 0
959 #define Z_ListEntries_nonSurrogateDiagnostics 1
963 Z_DiagRecs *nonSurrogateDiagnostics;
967 typedef struct Z_ScanRequest
969 Z_ReferenceId *referenceId; /* OPTIONAL */
970 int num_databaseNames;
971 char **databaseNames;
972 Odr_oid *attributeSet; /* OPTIONAL */
973 Z_AttributesPlusTerm *termListAndStartPoint;
974 int *stepSize; /* OPTIONAL */
975 int *numberOfTermsRequested;
976 int *preferredPositionInResponse; /* OPTIONAL */
978 Z_OtherInformation *otherInfo;
982 typedef struct Z_ScanResponse
984 Z_ReferenceId *referenceId; /* OPTIONAL */
985 int *stepSize; /* OPTIONAL */
987 #define Z_Scan_success 0
988 #define Z_Scan_partial_1 1
989 #define Z_Scan_partial_2 2
990 #define Z_Scan_partial_3 3
991 #define Z_Scan_partial_4 4
992 #define Z_Scan_partial_5 5
993 #define Z_Scan_failure 6
994 int *numberOfEntriesReturned;
995 int *positionOfTerm; /* OPTIONAL */
996 Z_ListEntries *entries; /* OPTIONAL */
997 Odr_oid *attributeSet; /* OPTIONAL */
999 Z_OtherInformation *otherInfo;
1004 /* ------------------------ DELETE -------------------------- */
1006 #define Z_DeleteStatus_success 0
1007 #define Z_DeleteStatus_resultSetDidNotExist 1
1008 #define Z_DeleteStatus_previouslyDeletedByTarget 2
1009 #define Z_DeleteStatus_systemProblemAtTarget 3
1010 #define Z_DeleteStatus_accessNotAllowed 4
1011 #define Z_DeleteStatus_resourceControlAtOrigin 5
1012 #define Z_DeleteStatus_resourceControlAtTarget 6
1013 #define Z_DeleteStatus_bulkDeleteNotSupported 7
1014 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
1015 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
1016 #define Z_DeleteStatus_resultSetInUse 10
1018 typedef struct Z_ListStatus
1024 typedef struct Z_DeleteResultSetRequest
1026 Z_ReferenceId *referenceId; /* OPTIONAL */
1027 int *deleteFunction;
1028 #define Z_DeleteRequest_list 0
1029 #define Z_DeleteRequest_all 1
1030 int num_resultSetList;
1031 Z_ResultSetId **resultSetList; /* OPTIONAL */
1033 Z_OtherInformation *otherInfo;
1035 } Z_DeleteResultSetRequest;
1037 typedef struct Z_ListStatuses {
1039 Z_ListStatus **elements;
1042 typedef struct Z_DeleteResultSetResponse
1044 Z_ReferenceId *referenceId; /* OPTIONAL */
1045 int *deleteOperationStatus;
1046 Z_ListStatuses *deleteListStatuses;/* OPTIONAL */
1047 int *numberNotDeleted; /* OPTIONAL */
1048 Z_ListStatuses *bulkStatuses; /* OPTIONAL */
1049 char *deleteMessage; /* OPTIONAL */
1051 Z_OtherInformation *otherInfo;
1053 } Z_DeleteResultSetResponse;
1055 /* ------------------------ CLOSE SERVICE ------------------- */
1057 typedef struct Z_Close
1059 Z_ReferenceId *referenceId; /* OPTIONAL */
1061 #define Z_Close_finished 0
1062 #define Z_Close_shutdown 1
1063 #define Z_Close_systemProblem 2
1064 #define Z_Close_costLimit 3
1065 #define Z_Close_resources 4
1066 #define Z_Close_securityViolation 5
1067 #define Z_Close_protocolError 6
1068 #define Z_Close_lackOfActivity 7
1069 #define Z_Close_peerAbort 8
1070 #define Z_Close_unspecified 9
1071 char *diagnosticInformation; /* OPTIONAL */
1072 Odr_oid *resourceReportFormat; /* OPTIONAL */
1073 Z_External *resourceReport; /* OPTIONAL */
1075 Z_OtherInformation *otherInfo; /* OPTIONAL */
1079 /* ------------------------ SEGMENTATION -------------------- */
1081 typedef struct Z_Segment
1083 Z_ReferenceId *referenceId; /* OPTIONAL */
1084 int *numberOfRecordsReturned;
1085 int num_segmentRecords;
1086 Z_NamePlusRecord **segmentRecords;
1087 Z_OtherInformation *otherInfo; /* OPTIONAL */
1090 /* ----------------------- Extended Services ---------------- */
1092 typedef struct Z_Permissions
1095 int num_allowableFunctions;
1096 int **allowableFunctions;
1097 #define Z_Permissions_delete 1
1098 #define Z_Permissions_modifyContents 2
1099 #define Z_Permissions_modifyPermissions 3
1100 #define Z_Permissions_present 4
1101 #define Z_Permissions_invoke 5
1104 typedef struct Z_ExtendedServicesRequest
1106 Z_ReferenceId *referenceId; /* OPTIONAL */
1108 #define Z_ExtendedServicesRequest_create 1
1109 #define Z_ExtendedServicesRequest_delete 2
1110 #define Z_ExtendedServicesRequest_modify 3
1111 Odr_oid *packageType;
1112 char *packageName; /* OPTIONAL */
1113 char *userId; /* OPTIONAL */
1114 Z_IntUnit *retentionTime; /* OPTIONAL */
1115 Z_Permissions *permissions; /* OPTIONAL */
1116 char *description; /* OPTIONAL */
1117 Z_External *taskSpecificParameters; /* OPTIONAL */
1119 #define Z_ExtendedServicesRequest_wait 1
1120 #define Z_ExtendedServicesRequest_waitIfPossible 2
1121 #define Z_ExtendedServicesRequest_dontWait 3
1122 #define Z_ExtendedServicesRequest_dontReturnPackage 4
1123 char *elements; /* OPTIONAL */
1124 Z_OtherInformation *otherInfo; /* OPTIONAL */
1125 } Z_ExtendedServicesRequest;
1127 typedef struct Z_ExtendedServicesResponse
1129 Z_ReferenceId *referenceId; /* OPTIONAL */
1130 int *operationStatus;
1131 #define Z_ExtendedServicesResponse_done 1
1132 #define Z_ExtendedServicesResponse_accepted 2
1133 #define Z_ExtendedServicesResponse_failure 3
1134 int num_diagnostics;
1135 Z_DiagRec **diagnostics; /* OPTIONAL */
1136 Z_External *taskPackage; /* OPTIONAL */
1137 Z_OtherInformation *otherInfo; /* OPTIONAL */
1138 } Z_ExtendedServicesResponse;
1140 /* ------------------------ Sort --------------------------- */
1142 typedef struct Z_SortAttributes
1145 Z_AttributeList *list;
1148 typedef struct Z_SortKey
1151 #define Z_SortKey_sortField 0
1152 #define Z_SortKey_elementSpec 1
1153 #define Z_SortKey_sortAttributes 2
1157 Z_Specification *elementSpec;
1158 Z_SortAttributes *sortAttributes;
1162 typedef struct Z_SortDbSpecific
1168 typedef struct Z_SortDbSpecificList
1171 Z_SortDbSpecific **dbSpecific;
1172 } Z_SortDbSpecificList;
1174 typedef struct Z_SortElement
1177 #define Z_SortElement_generic 0
1178 #define Z_SortElement_databaseSpecific 1
1182 Z_SortDbSpecificList *databaseSpecific;
1186 typedef struct Z_SortMissingValueAction
1189 #define Z_SortMissingValAct_abort 0
1190 #define Z_SortMissingValAct_null 1
1191 #define Z_SortMissingValAct_valData 2
1198 } Z_SortMissingValueAction;
1200 typedef struct Z_SortKeySpec
1202 Z_SortElement *sortElement;
1204 #define Z_SortRelation_ascending 0
1205 #define Z_SortRelation_descending 1
1206 #define Z_SortRelation_ascendingByFreq 3
1207 #define Z_SortRelation_descendingByFreq 4
1208 int *caseSensitivity;
1209 #define Z_SortCase_caseSensitive 0
1210 #define Z_SortCase_caseInsensitive 1
1211 Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
1214 typedef struct Z_SortResponse
1216 Z_ReferenceId *referenceId; /* OPTIONAL */
1218 #define Z_SortStatus_success 0
1219 #define Z_SortStatus_partial_1 1
1220 #define Z_SortStatus_failure 2
1221 int *resultSetStatus; /* OPTIONAL */
1222 #define Z_SortResultSetStatus_empty 1
1223 #define Z_SortResultSetStatus_interim 2
1224 #define Z_SortResultSetStatus_unchanged 3
1225 #define Z_SortResultSetStatus_none 4
1226 Z_DiagRecs *diagnostics; /* OPTIONAL */
1227 Z_OtherInformation *otherInfo; /* OPTIONAL */
1230 typedef struct Z_SortKeySpecList
1233 Z_SortKeySpec **specs;
1234 } Z_SortKeySpecList;
1236 typedef struct Z_SortRequest
1238 Z_ReferenceId *referenceId; /* OPTIONAL */
1239 Z_StringList *inputResultSetNames;
1240 char *sortedResultSetName;
1241 Z_SortKeySpecList *sortSequence;
1242 Z_OtherInformation *otherInfo; /* OPTIONAL */
1245 /* ----------------------- Resource Report ------------------ */
1247 typedef struct Z_ResourceReportRequest
1249 Z_ReferenceId *referenceId; /* OPTIONAL */
1250 Z_ReferenceId *opId; /* OPTIONAL */
1251 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
1252 Z_OtherInformation *otherInfo; /* OPTIONAL */
1253 } Z_ResourceReportRequest;
1255 typedef struct Z_ResourceReportResponse
1257 Z_ReferenceId *referenceId; /* OPTIONAL */
1258 int *resourceReportStatus;
1259 #define Z_ResourceReportStatus_success 0
1260 #define Z_ResourceReportStatus_partial 1
1261 #define Z_ResourceReportStatus_failure_1 2
1262 #define Z_ResourceReportStatus_failure_2 3
1263 #define Z_ResourceReportStatus_failure_3 4
1264 #define Z_ResourceReportStatus_failure_4 5
1265 #define Z_ResourceReportStatus_failure_5 6
1266 #define Z_ResourceReportStatus_failure_6 7
1267 Z_External *resourceReport; /* OPTIONAL */
1268 Z_OtherInformation *otherInfo; /* OPTIONAL */
1269 } Z_ResourceReportResponse;
1271 /* ------------------------ APDU ---------------------------- */
1273 typedef struct Z_APDU
1276 #define Z_APDU_initRequest 0
1277 #define Z_APDU_initResponse 1
1278 #define Z_APDU_searchRequest 2
1279 #define Z_APDU_searchResponse 3
1280 #define Z_APDU_presentRequest 4
1281 #define Z_APDU_presentResponse 5
1282 #define Z_APDU_deleteResultSetRequest 6
1283 #define Z_APDU_deleteResultSetResponse 7
1284 #define Z_APDU_resourceControlRequest 8
1285 #define Z_APDU_resourceControlResponse 9
1286 #define Z_APDU_triggerResourceControlRequest 10
1287 #define Z_APDU_scanRequest 11
1288 #define Z_APDU_scanResponse 12
1289 #define Z_APDU_segmentRequest 13
1290 #define Z_APDU_extendedServicesRequest 14
1291 #define Z_APDU_extendedServicesResponse 15
1292 #define Z_APDU_close 16
1293 #define Z_APDU_accessControlRequest 17
1294 #define Z_APDU_accessControlResponse 18
1295 #define Z_APDU_sortRequest 20
1296 #define Z_APDU_sortResponse 21
1297 #define Z_APDU_resourceReportRequest 22
1298 #define Z_APDU_resourceReportResponse 23
1301 Z_InitRequest *initRequest;
1302 Z_InitResponse *initResponse;
1303 Z_SearchRequest *searchRequest;
1304 Z_SearchResponse *searchResponse;
1305 Z_PresentRequest *presentRequest;
1306 Z_PresentResponse *presentResponse;
1307 Z_DeleteResultSetRequest *deleteResultSetRequest;
1308 Z_DeleteResultSetResponse *deleteResultSetResponse;
1309 Z_AccessControlRequest *accessControlRequest;
1310 Z_AccessControlResponse *accessControlResponse;
1311 Z_ResourceControlRequest *resourceControlRequest;
1312 Z_ResourceControlResponse *resourceControlResponse;
1313 Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1314 Z_ResourceReportRequest *resourceReportRequest;
1315 Z_ResourceReportResponse *resourceReportResponse;
1316 Z_ScanRequest *scanRequest;
1317 Z_ScanResponse *scanResponse;
1318 Z_SortRequest *sortRequest;
1319 Z_SortResponse *sortResponse;
1320 Z_Segment *segmentRequest;
1321 Z_ExtendedServicesRequest *extendedServicesRequest;
1322 Z_ExtendedServicesResponse *extendedServicesResponse;
1327 YAZ_EXPORT int z_APDU(ODR o, Z_APDU **p, int opt);
1328 YAZ_EXPORT int z_SUTRS(ODR o, Odr_oct **p, int opt);
1330 YAZ_EXPORT Z_InitRequest *zget_InitRequest(ODR o);
1331 YAZ_EXPORT Z_InitResponse *zget_InitResponse(ODR o);
1332 YAZ_EXPORT Z_SearchRequest *zget_SearchRequest(ODR o);
1333 YAZ_EXPORT Z_SearchResponse *zget_SearchResponse(ODR o);
1334 YAZ_EXPORT Z_PresentRequest *zget_PresentRequest(ODR o);
1335 YAZ_EXPORT Z_PresentResponse *zget_PresentResponse(ODR o);
1336 YAZ_EXPORT Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1337 YAZ_EXPORT Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1338 YAZ_EXPORT Z_ScanRequest *zget_ScanRequest(ODR o);
1339 YAZ_EXPORT Z_ScanResponse *zget_ScanResponse(ODR o);
1340 YAZ_EXPORT Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1341 YAZ_EXPORT Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1342 YAZ_EXPORT Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1343 YAZ_EXPORT Z_Close *zget_Close(ODR o);
1344 YAZ_EXPORT int z_StringList(ODR o, Z_StringList **p, int opt);
1345 YAZ_EXPORT int z_InternationalString(ODR o, char **p, int opt);
1346 YAZ_EXPORT int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt);
1347 YAZ_EXPORT int z_ElementSetName(ODR o, char **p, int opt);
1348 YAZ_EXPORT int z_IntUnit(ODR o, Z_IntUnit **p, int opt);
1349 YAZ_EXPORT int z_Unit(ODR o, Z_Unit **p, int opt);
1350 YAZ_EXPORT int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt);
1351 YAZ_EXPORT int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt);
1352 YAZ_EXPORT int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt);
1353 YAZ_EXPORT int z_Term(ODR o, Z_Term **p, int opt);
1354 YAZ_EXPORT int z_Specification(ODR o, Z_Specification **p, int opt);
1355 YAZ_EXPORT int z_Permissions(ODR o, Z_Permissions **p, int opt);
1356 YAZ_EXPORT int z_DiagRec(ODR o, Z_DiagRec **p, int opt);
1357 YAZ_EXPORT int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt);
1358 YAZ_EXPORT int z_AttributeList(ODR o, Z_AttributeList **p, int opt);
1359 YAZ_EXPORT int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt);
1360 YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which);
1361 YAZ_EXPORT int z_Query(ODR o, Z_Query **p, int opt);
1367 #include <prt-rsc.h>
1368 #include <prt-acc.h>
1369 #include <prt-exp.h>
1370 #include <prt-grs.h>
1371 #include <prt-arc.h>
1372 #include <prt-exd.h>
1373 #include <prt-dia.h>
1374 #include <prt-esp.h>
1375 #include <prt-add.h>
1377 #include <prt-dat.h>
1378 #include <prt-univ.h>
1379 #include <prt-ext.h>