2 * Copyright (c) 1995-1999, 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.47 1999-04-20 09:56:48 adam
28 * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun).
29 * Modified all encoders/decoders to reflect this change.
31 * Revision 1.46 1998/10/20 13:55:44 quinn
32 * Fixed Scan bug in asn and client
34 * Revision 1.45 1998/08/19 16:10:07 adam
35 * Changed som member names of DeleteResultSetRequest/Response.
37 * Revision 1.44 1998/05/18 10:14:08 adam
38 * Minor change - removed 'dead' definitions.
40 * Revision 1.43 1998/03/31 11:07:45 adam
41 * Furhter work on UNIverse resource report.
42 * Added Extended Services handling in frontend server.
44 * Revision 1.42 1998/03/20 14:46:06 adam
45 * Added UNIverse Resource Reports.
47 * Revision 1.41 1998/02/10 15:31:52 adam
48 * Implemented date and time structure. Changed the Update Extended
51 * Revision 1.40 1997/09/01 08:49:50 adam
52 * New windows NT/95 port using MSV5.0. To export DLL functions the
53 * YAZ_EXPORT modifier was added. Defined in yconfig.h.
55 * Revision 1.39 1997/05/14 06:53:44 adam
58 * Revision 1.38 1997/04/30 08:52:09 quinn
61 * Revision 1.37 1996/10/09 15:54:58 quinn
62 * Added SearchInfoReport
64 * Revision 1.36 1996/10/07 15:29:20 quinn
67 * Revision 1.35 1996/06/10 08:57:38 quinn
68 * Added OPAC, ResourceReport
70 * Revision 1.34 1996/06/10 08:55:36 quinn
73 * Revision 1.33 1996/02/23 10:00:51 quinn
76 * Revision 1.32 1996/02/20 12:52:39 quinn
79 * Revision 1.31 1996/01/22 09:46:45 quinn
80 * Added Sort PDU. Moved StringList to main protocol file.
82 * Revision 1.30 1996/01/10 15:21:32 quinn
83 * Added links to access control PDUs
85 * Revision 1.29 1996/01/02 11:46:49 quinn
86 * Changed 'operator' to 'roperator' to avoid C++ conflict.
89 * Revision 1.28 1996/01/02 08:57:32 quinn
90 * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
92 * Revision 1.27 1995/10/12 10:34:46 quinn
95 * Revision 1.26 1995/09/29 17:12:08 quinn
98 * Revision 1.25 1995/09/27 15:02:49 quinn
99 * Modified function heads & prototypes.
101 * Revision 1.24 1995/08/29 11:17:43 quinn
102 * *** empty log message ***
104 * Revision 1.23 1995/08/21 09:10:36 quinn
105 * Smallish fixes to suppport new formats.
107 * Revision 1.22 1995/08/17 12:45:14 quinn
108 * Fixed minor problems with GRS-1. Added support in c&s.
110 * Revision 1.21 1995/08/15 12:00:11 quinn
113 * Revision 1.20 1995/08/10 08:54:35 quinn
116 * Revision 1.19 1995/06/19 12:38:28 quinn
117 * Reorganized include-files. Added small features.
119 * Revision 1.18 1995/06/16 13:16:05 quinn
120 * Fixed Defaultdiagformat.
122 * Revision 1.17 1995/06/15 15:42:05 quinn
125 * Revision 1.16 1995/06/15 07:45:06 quinn
128 * Revision 1.15 1995/06/14 15:26:43 quinn
129 * *** empty log message ***
131 * Revision 1.14 1995/06/07 14:42:34 quinn
134 * Revision 1.13 1995/06/07 14:36:47 quinn
137 * Revision 1.12 1995/06/05 10:53:13 quinn
140 * Revision 1.11 1995/06/02 09:49:47 quinn
143 * Revision 1.10 1995/05/29 08:11:34 quinn
144 * Moved oid from odr/asn to util.
146 * Revision 1.9 1995/05/22 11:31:25 quinn
149 * Revision 1.8 1995/05/17 08:41:35 quinn
150 * Added delete to proto & other little things.
151 * Relaying auth info to backend.
153 * Revision 1.7 1995/05/16 08:50:37 quinn
154 * License, documentation, and memory fixes
156 * Revision 1.6 1995/05/15 11:55:55 quinn
157 * Work on asynchronous activity.
159 * Revision 1.5 1995/04/17 11:28:18 quinn
162 * Revision 1.4 1995/04/10 10:22:47 quinn
165 * Revision 1.3 1995/03/30 12:18:09 quinn
168 * Revision 1.2 1995/03/30 10:26:48 quinn
169 * Added Term structure
171 * Revision 1.1 1995/03/30 09:39:42 quinn
172 * Moved .h files to include directory
174 * Revision 1.11 1995/03/30 09:08:44 quinn
175 * Added Resource control protocol
177 * Revision 1.10 1995/03/29 15:39:39 quinn
178 * Adding some resource control elements, and a null-check to getentbyoid
180 * Revision 1.9 1995/03/29 08:06:18 quinn
181 * Added a few v3 elements
183 * Revision 1.8 1995/03/22 10:12:49 quinn
184 * Added Z_PRES constants.
186 * Revision 1.7 1995/03/20 09:45:12 quinn
189 * Revision 1.5 1995/03/07 16:29:34 quinn
190 * Added authentication stuff.
192 * Revision 1.4 1995/03/07 10:13:00 quinn
193 * Added prototype for z_APDU()
195 * Revision 1.3 1995/02/14 11:54:23 quinn
198 * Revision 1.2 1995/02/09 15:51:40 quinn
201 * Revision 1.1 1995/02/06 16:44:48 quinn
202 * First hack at Z/SR protocol
213 #include <yaz-version.h>
219 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
222 typedef struct Z_External Z_External;
224 typedef Odr_oct Z_ReferenceId;
225 typedef char Z_DatabaseName;
226 typedef char Z_ResultSetId;
227 typedef Odr_oct Z_ResultsetId;
229 typedef struct Z_InfoCategory
231 Odr_oid *categoryTypeId; /* OPTIONAL */
235 typedef struct Z_OtherInformationUnit
237 Z_InfoCategory *category; /* OPTIONAL */
239 #define Z_OtherInfo_characterInfo 0
240 #define Z_OtherInfo_binaryInfo 1
241 #define Z_OtherInfo_externallyDefinedInfo 2
242 #define Z_OtherInfo_oid 3
247 Z_External *externallyDefinedInfo;
250 } Z_OtherInformationUnit;
252 typedef struct Z_OtherInformation
255 Z_OtherInformationUnit **list;
256 } Z_OtherInformation;
258 typedef struct Z_StringOrNumeric
261 #define Z_StringOrNumeric_string 0
262 #define Z_StringOrNumeric_numeric 1
270 typedef struct Z_Unit
272 char *unitSystem; /* OPTIONAL */
273 Z_StringOrNumeric *unitType; /* OPTIONAL */
274 Z_StringOrNumeric *unit; /* OPTIONAL */
275 int *scaleFactor; /* OPTIONAL */
278 typedef struct Z_IntUnit
284 typedef Odr_oct Z_SUTRS;
286 typedef struct Z_StringList
292 /* ----------------- INIT SERVICE ----------------*/
296 char *groupId; /* OPTIONAL */
297 char *userId; /* OPTIONAL */
298 char *password; /* OPTIONAL */
301 typedef struct Z_IdAuthentication
304 #define Z_IdAuthentication_open 0
305 #define Z_IdAuthentication_idPass 1
306 #define Z_IdAuthentication_anonymous 2
307 #define Z_IdAuthentication_other 3
315 } Z_IdAuthentication;
317 #define Z_ProtocolVersion_1 0
318 #define Z_ProtocolVersion_2 1
319 #define Z_ProtocolVersion_3 2
321 #define Z_Options_search 0
322 #define Z_Options_present 1
323 #define Z_Options_delSet 2
324 #define Z_Options_resourceReport 3
325 #define Z_Options_triggerResourceCtrl 4
326 #define Z_Options_resourceCtrl 5
327 #define Z_Options_accessCtrl 6
328 #define Z_Options_scan 7
329 #define Z_Options_sort 8
330 #define Z_Options_reserved 9
331 #define Z_Options_extendedServices 10
332 #define Z_Options_level_1Segmentation 11
333 #define Z_Options_level_2Segmentation 12
334 #define Z_Options_concurrentOperations 13
335 #define Z_Options_namedResultSets 14
337 typedef struct Z_InitRequest
339 Z_ReferenceId *referenceId; /* OPTIONAL */
340 Odr_bitmask *protocolVersion;
341 Odr_bitmask *options;
342 int *preferredMessageSize;
343 int *maximumRecordSize;
344 Z_IdAuthentication* idAuthentication; /* OPTIONAL */
345 char *implementationId; /* OPTIONAL */
346 char *implementationName; /* OPTIONAL */
347 char *implementationVersion; /* OPTIONAL */
348 Z_External *userInformationField; /* OPTIONAL */
349 Z_OtherInformation *otherInfo; /* OPTIONAL */
352 typedef struct Z_InitResponse
354 Z_ReferenceId *referenceId; /* OPTIONAL */
355 Odr_bitmask *protocolVersion;
356 Odr_bitmask *options;
357 int *preferredMessageSize;
358 int *maximumRecordSize;
360 char *implementationId; /* OPTIONAL */
361 char *implementationName; /* OPTIONAL */
362 char *implementationVersion; /* OPTIONAL */
363 Z_External *userInformationField; /* OPTIONAL */
364 Z_OtherInformation *otherInfo; /* OPTIONAL */
367 typedef struct Z_NSRAuthentication
372 } Z_NSRAuthentication;
374 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt,
377 int z_StrAuthentication(ODR o, char **p, int opt, const char *name);
379 /* ------------------ SEARCH SERVICE ----------------*/
381 typedef struct Z_DatabaseSpecificUnit
384 char *elementSetName;
385 } Z_DatabaseSpecificUnit;
387 typedef struct Z_DatabaseSpecific
390 Z_DatabaseSpecificUnit **elements;
391 } Z_DatabaseSpecific;
393 typedef struct Z_ElementSetNames
396 #define Z_ElementSetNames_generic 0
397 #define Z_ElementSetNames_databaseSpecific 1
401 Z_DatabaseSpecific *databaseSpecific;
405 /* ---------------------- RPN QUERY --------------------------- */
407 typedef struct Z_ComplexAttribute
410 Z_StringOrNumeric **list;
411 int num_semanticAction;
412 int **semanticAction; /* OPTIONAL */
413 } Z_ComplexAttribute;
415 typedef struct Z_AttributeElement
417 Odr_oid *attributeSet; /* OPTIONAL - v3 only */
420 #define Z_AttributeValue_numeric 0
421 #define Z_AttributeValue_complex 1
425 Z_ComplexAttribute *complex;
427 } Z_AttributeElement;
429 typedef struct Z_Term
432 #define Z_Term_general 0
433 #define Z_Term_numeric 1
434 #define Z_Term_characterString 2
436 #define Z_Term_dateTime 4
437 #define Z_Term_external 5
438 #define Z_Term_integerAndUnit 6
439 #define Z_Term_null 7
442 Odr_oct *general; /* this is required for v2 */
444 char *characterString;
447 Z_External *external;
448 /* Z_IntUnit *integerAndUnit; */
453 typedef struct Z_AttributesPlusTerm
456 Z_AttributeElement **attributeList;
458 } Z_AttributesPlusTerm;
460 typedef struct Z_ResultSetPlusAttributes
464 Z_AttributeElement **attributeList;
465 } Z_ResultSetPlusAttributes;
467 typedef struct Z_ProximityOperator
469 bool_t *exclusion; /* OPTIONAL */
473 #define Z_Prox_lessThan 1
474 #define Z_Prox_lessThanOrEqual 2
475 #define Z_Prox_equal 3
476 #define Z_Prox_greaterThanOrEqual 4
477 #define Z_Prox_greaterThan 5
478 #define Z_Prox_notEqual 6
480 #define Z_ProxCode_known 0
481 #define Z_ProxCode_private 1
482 int *proximityUnitCode;
483 #define Z_ProxUnit_character 1
484 #define Z_ProxUnit_word 2
485 #define Z_ProxUnit_sentence 3
486 #define Z_ProxUnit_paragraph 4
487 #define Z_ProxUnit_section 5
488 #define Z_ProxUnit_chapter 6
489 #define Z_ProxUnit_document 7
490 #define Z_ProxUnit_element 8
491 #define Z_ProxUnit_subelement 9
492 #define Z_ProxUnit_elementType 10
493 #define Z_ProxUnit_byte 11 /* v3 only */
494 } Z_ProximityOperator;
496 typedef struct Z_Operator
499 #define Z_Operator_and 0
500 #define Z_Operator_or 1
501 #define Z_Operator_and_not 2
502 #define Z_Operator_prox 3
505 Odr_null *and; /* these guys are nulls. */
508 Z_ProximityOperator *prox;
512 typedef struct Z_Operand
515 #define Z_Operand_APT 0
516 #define Z_Operand_resultSetId 1
517 #define Z_Operand_resultAttr /* v3 only */ 2
520 Z_AttributesPlusTerm *attributesPlusTerm;
521 Z_ResultSetId *resultSetId;
522 Z_ResultSetPlusAttributes *resultAttr;
526 typedef struct Z_Complex
528 struct Z_RPNStructure *s1;
529 struct Z_RPNStructure *s2;
530 Z_Operator *roperator;
533 typedef struct Z_RPNStructure
536 #define Z_RPNStructure_simple 0
537 #define Z_RPNStructure_complex 1
545 typedef struct Z_RPNQuery
547 Odr_oid *attributeSetId;
548 Z_RPNStructure *RPNStructure;
551 /* -------------------------- SEARCHREQUEST -------------------------- */
553 typedef struct Z_Query
556 #define Z_Query_type_1 1
557 #define Z_Query_type_2 2
558 #define Z_Query_type_101 3
563 Z_RPNQuery *type_101;
567 typedef struct Z_SearchRequest
569 Z_ReferenceId *referenceId; /* OPTIONAL */
570 int *smallSetUpperBound;
571 int *largeSetLowerBound;
572 int *mediumSetPresentNumber;
573 bool_t *replaceIndicator;
575 int num_databaseNames;
576 char **databaseNames;
577 Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */
578 Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */
579 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
581 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */
582 Z_OtherInformation *otherInfo; /* OPTIONAL */
585 /* ------------------------ RECORD -------------------------- */
587 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;
613 typedef struct Z_DiagRecs
616 Z_DiagRec **diagRecs;
619 typedef struct Z_NamePlusRecord
621 char *databaseName; /* OPTIONAL */
623 #define Z_NamePlusRecord_databaseRecord 0
624 #define Z_NamePlusRecord_surrogateDiagnostic 1
627 Z_DatabaseRecord *databaseRecord;
628 Z_DiagRec *surrogateDiagnostic;
632 typedef struct Z_NamePlusRecordList
635 Z_NamePlusRecord **records;
636 } Z_NamePlusRecordList;
638 typedef struct Z_Records
641 #define Z_Records_DBOSD 0
642 #define Z_Records_NSD 1
643 #define Z_Records_multipleNSD 2
646 Z_NamePlusRecordList *databaseOrSurDiagnostics;
647 Z_DiagRec *nonSurrogateDiagnostic;
648 Z_DiagRecs *multipleNonSurDiagnostics;
652 /* ------------------------ SEARCHRESPONSE ------------------ */
654 typedef struct Z_SearchResponse
656 Z_ReferenceId *referenceId; /* OPTIONAL */
658 int *numberOfRecordsReturned;
659 int *nextResultSetPosition;
660 bool_t *searchStatus;
661 int *resultSetStatus; /* OPTIONAL */
662 #define Z_RES_SUBSET 1
663 #define Z_RES_INTERIM 2
665 int *presentStatus; /* OPTIONAL */
666 #define Z_PRES_SUCCESS 0
667 #define Z_PRES_PARTIAL_1 1
668 #define Z_PRES_PARTIAL_2 2
669 #define Z_PRES_PARTIAL_3 3
670 #define Z_PRES_PARTIAL_4 4
671 #define Z_PRES_FAILURE 5
672 Z_Records *records; /* OPTIONAL */
673 Z_OtherInformation *additionalSearchInfo;
674 Z_OtherInformation *otherInfo;
677 /* ------------------------- PRESENT SERVICE -----------------*/
679 typedef struct Z_ElementSpec
682 #define Z_ElementSpec_elementSetName 0
683 #define Z_ElementSpec_externalSpec 1
686 char *elementSetName;
687 Z_External *externalSpec;
691 typedef struct Z_Specification
693 Odr_oid *schema; /* OPTIONAL */
694 Z_ElementSpec *elementSpec; /* OPTIONAL */
697 typedef struct Z_DbSpecific
700 Z_Specification *spec;
703 typedef struct Z_CompSpec
705 bool_t *selectAlternativeSyntax;
706 Z_Specification *generic; /* OPTIONAL */
708 Z_DbSpecific **dbSpecific; /* OPTIONAL */
709 int num_recordSyntax;
710 Odr_oid **recordSyntax; /* OPTIONAL */
713 typedef struct Z_RecordComposition
716 #define Z_RecordComp_simple 0
717 #define Z_RecordComp_complex 1
720 Z_ElementSetNames *simple;
723 } Z_RecordComposition;
725 typedef struct Z_Range
727 int *startingPosition;
728 int *numberOfRecords;
731 typedef struct Z_PresentRequest
733 Z_ReferenceId *referenceId; /* OPTIONAL */
734 Z_ResultSetId *resultSetId;
735 int *resultSetStartPoint;
736 int *numberOfRecordsRequested;
738 Z_Range **additionalRanges; /* OPTIONAL */
739 Z_RecordComposition *recordComposition; /* OPTIONAL */
740 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
741 int *maxSegmentCount; /* OPTIONAL */
742 int *maxRecordSize; /* OPTIONAL */
743 int *maxSegmentSize; /* OPTIONAL */
744 Z_OtherInformation *otherInfo; /* OPTIONAL */
747 typedef struct Z_PresentResponse
749 Z_ReferenceId *referenceId; /* OPTIONAL */
750 int *numberOfRecordsReturned;
751 int *nextResultSetPosition;
754 Z_OtherInformation *otherInfo; /* OPTIONAL */
757 /* ------------------ RESOURCE CONTROL ----------------*/
759 typedef struct Z_TriggerResourceControlRequest
761 Z_ReferenceId *referenceId; /* OPTIONAL */
762 int *requestedAction;
763 #define Z_TriggerResourceCtrl_resourceReport 1
764 #define Z_TriggerResourceCtrl_resourceControl 2
765 #define Z_TriggerResourceCtrl_cancel 3
766 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
767 bool_t *resultSetWanted; /* OPTIONAL */
768 Z_OtherInformation *otherInfo;
769 } Z_TriggerResourceControlRequest;
771 typedef struct Z_ResourceControlRequest
773 Z_ReferenceId *referenceId; /* OPTIONAL */
774 bool_t *suspendedFlag; /* OPTIONAL */
775 Z_External *resourceReport; /* OPTIONAL */
776 int *partialResultsAvailable; /* OPTIONAL */
777 #define Z_ResourceControlRequest_subset 1
778 #define Z_ResourceControlRequest_interim 2
779 #define Z_ResourceControlRequest_none 3
780 bool_t *responseRequired;
781 bool_t *triggeredRequestFlag; /* OPTIONAL */
782 Z_OtherInformation *otherInfo;
783 } Z_ResourceControlRequest;
785 typedef struct Z_ResourceControlResponse
787 Z_ReferenceId *referenceId; /* OPTIONAL */
788 bool_t *continueFlag;
789 bool_t *resultSetWanted; /* OPTIONAL */
790 Z_OtherInformation *otherInfo;
791 } Z_ResourceControlResponse;
794 /* ------------------ ACCESS CTRL SERVICE ----------------*/
796 typedef struct Z_AccessControlRequest
798 Z_ReferenceId *referenceId; /* OPTIONAL */
800 #define Z_AccessRequest_simpleForm 0
801 #define Z_AccessRequest_externallyDefined 1
805 Z_External *externallyDefined;
807 Z_OtherInformation *otherInfo; /* OPTIONAL */
808 } Z_AccessControlRequest;
810 typedef struct Z_AccessControlResponse
812 Z_ReferenceId *referenceId; /* OPTIONAL */
814 #define Z_AccessResponse_simpleForm 0
815 #define Z_AccessResponse_externallyDefined 1
819 Z_External *externallyDefined;
821 Z_DiagRec *diagnostic; /* OPTIONAL */
822 Z_OtherInformation *otherInfo; /* OPTIONAL */
823 } Z_AccessControlResponse;
825 /* ------------------------ SCAN SERVICE -------------------- */
827 typedef struct Z_AttributeList
830 Z_AttributeElement **attributes;
833 typedef struct Z_AlternativeTerm
836 Z_AttributesPlusTerm **terms;
839 typedef struct Z_ByDatabase
842 int *num; /* OPTIONAL */
843 Z_OtherInformation *otherDbInfo; /* OPTIONAL */
846 typedef struct Z_ByDatabaseList
849 Z_ByDatabase **elements;
852 typedef struct Z_ScanOccurrences
855 #define Z_ScanOccurrences_global 0
856 #define Z_ScanOccurrences_byDatabase 1
860 Z_ByDatabaseList *byDatabase;
865 typedef struct Z_OccurrenceByAttributesElem
867 Z_AttributeList *attributes;
868 Z_ScanOccurrences *occurrences; /* OPTIONAL */
869 Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
870 } Z_OccurrenceByAttributesElem;
872 typedef struct Z_OccurrenceByAttributes
875 Z_OccurrenceByAttributesElem **elements;
876 } Z_OccurrenceByAttributes;
878 typedef struct Z_TermInfo
881 char *displayTerm; /* OPTIONAL */
882 Z_AttributeList *suggestedAttributes; /* OPTIONAL */
883 Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
884 int *globalOccurrences; /* OPTIONAL */
885 Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
886 Z_OtherInformation *otherTermInfo; /* OPTIONAL */
889 typedef struct Z_Entry
892 #define Z_Entry_termInfo 0
893 #define Z_Entry_surrogateDiagnostic 1
896 Z_TermInfo *termInfo;
897 Z_DiagRec *surrogateDiagnostic;
901 #ifdef BUGGY_LISTENTRIES
903 typedef struct Z_Entries
909 typedef struct Z_ListEntries
912 #define Z_ListEntries_entries 0
913 #define Z_ListEntries_nonSurrogateDiagnostics 1
917 Z_DiagRecs *nonSurrogateDiagnostics;
923 typedef struct Z_ListEntries {
925 Z_Entry **entries; /* OPT */
926 int num_nonsurrogateDiagnostics;
927 Z_DiagRec **nonsurrogateDiagnostics; /* OPT */
930 typedef struct Z_ScanRequest
932 Z_ReferenceId *referenceId; /* OPTIONAL */
933 int num_databaseNames;
934 char **databaseNames;
935 Odr_oid *attributeSet; /* OPTIONAL */
936 Z_AttributesPlusTerm *termListAndStartPoint;
937 int *stepSize; /* OPTIONAL */
938 int *numberOfTermsRequested;
939 int *preferredPositionInResponse; /* OPTIONAL */
940 Z_OtherInformation *otherInfo;
943 typedef struct Z_ScanResponse
945 Z_ReferenceId *referenceId; /* OPTIONAL */
946 int *stepSize; /* OPTIONAL */
948 #define Z_Scan_success 0
949 #define Z_Scan_partial_1 1
950 #define Z_Scan_partial_2 2
951 #define Z_Scan_partial_3 3
952 #define Z_Scan_partial_4 4
953 #define Z_Scan_partial_5 5
954 #define Z_Scan_failure 6
955 int *numberOfEntriesReturned;
956 int *positionOfTerm; /* OPTIONAL */
957 Z_ListEntries *entries; /* OPTIONAL */
958 Odr_oid *attributeSet; /* OPTIONAL */
959 Z_OtherInformation *otherInfo;
963 /* ------------------------ DELETE -------------------------- */
965 #define Z_DeleteStatus_success 0
966 #define Z_DeleteStatus_resultSetDidNotExist 1
967 #define Z_DeleteStatus_previouslyDeletedByTarget 2
968 #define Z_DeleteStatus_systemProblemAtTarget 3
969 #define Z_DeleteStatus_accessNotAllowed 4
970 #define Z_DeleteStatus_resourceControlAtOrigin 5
971 #define Z_DeleteStatus_resourceControlAtTarget 6
972 #define Z_DeleteStatus_bulkDeleteNotSupported 7
973 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
974 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
975 #define Z_DeleteStatus_resultSetInUse 10
977 typedef struct Z_ListStatus
983 typedef struct Z_DeleteResultSetRequest
985 Z_ReferenceId *referenceId; /* OPTIONAL */
987 #define Z_DeleteRequest_list 0
988 #define Z_DeleteRequest_all 1
989 int num_resultSetList;
990 Z_ResultSetId **resultSetList; /* OPTIONAL */
991 Z_OtherInformation *otherInfo;
992 } Z_DeleteResultSetRequest;
994 typedef struct Z_ListStatuses {
996 Z_ListStatus **elements;
999 typedef struct Z_DeleteResultSetResponse
1001 Z_ReferenceId *referenceId; /* OPTIONAL */
1002 int *deleteOperationStatus;
1003 Z_ListStatuses *deleteListStatuses;/* OPTIONAL */
1004 int *numberNotDeleted; /* OPTIONAL */
1005 Z_ListStatuses *bulkStatuses; /* OPTIONAL */
1006 char *deleteMessage; /* OPTIONAL */
1007 Z_OtherInformation *otherInfo;
1008 } Z_DeleteResultSetResponse;
1010 /* ------------------------ CLOSE SERVICE ------------------- */
1012 typedef struct Z_Close
1014 Z_ReferenceId *referenceId; /* OPTIONAL */
1016 #define Z_Close_finished 0
1017 #define Z_Close_shutdown 1
1018 #define Z_Close_systemProblem 2
1019 #define Z_Close_costLimit 3
1020 #define Z_Close_resources 4
1021 #define Z_Close_securityViolation 5
1022 #define Z_Close_protocolError 6
1023 #define Z_Close_lackOfActivity 7
1024 #define Z_Close_peerAbort 8
1025 #define Z_Close_unspecified 9
1026 char *diagnosticInformation; /* OPTIONAL */
1027 Odr_oid *resourceReportFormat; /* OPTIONAL */
1028 Z_External *resourceReport; /* OPTIONAL */
1029 Z_OtherInformation *otherInfo; /* OPTIONAL */
1032 /* ------------------------ SEGMENTATION -------------------- */
1034 typedef struct Z_Segment
1036 Z_ReferenceId *referenceId; /* OPTIONAL */
1037 int *numberOfRecordsReturned;
1038 int num_segmentRecords;
1039 Z_NamePlusRecord **segmentRecords;
1040 Z_OtherInformation *otherInfo; /* OPTIONAL */
1043 /* ----------------------- Extended Services ---------------- */
1045 typedef struct Z_Permissions
1048 int num_allowableFunctions;
1049 int **allowableFunctions;
1050 #define Z_Permissions_delete 1
1051 #define Z_Permissions_modifyContents 2
1052 #define Z_Permissions_modifyPermissions 3
1053 #define Z_Permissions_present 4
1054 #define Z_Permissions_invoke 5
1057 typedef struct Z_ExtendedServicesRequest
1059 Z_ReferenceId *referenceId; /* OPTIONAL */
1061 #define Z_ExtendedServicesRequest_create 1
1062 #define Z_ExtendedServicesRequest_delete 2
1063 #define Z_ExtendedServicesRequest_modify 3
1064 Odr_oid *packageType;
1065 char *packageName; /* OPTIONAL */
1066 char *userId; /* OPTIONAL */
1067 Z_IntUnit *retentionTime; /* OPTIONAL */
1068 Z_Permissions *permissions; /* OPTIONAL */
1069 char *description; /* OPTIONAL */
1070 Z_External *taskSpecificParameters; /* OPTIONAL */
1072 #define Z_ExtendedServicesRequest_wait 1
1073 #define Z_ExtendedServicesRequest_waitIfPossible 2
1074 #define Z_ExtendedServicesRequest_dontWait 3
1075 #define Z_ExtendedServicesRequest_dontReturnPackage 4
1076 char *elements; /* OPTIONAL */
1077 Z_OtherInformation *otherInfo; /* OPTIONAL */
1078 } Z_ExtendedServicesRequest;
1080 typedef struct Z_ExtendedServicesResponse
1082 Z_ReferenceId *referenceId; /* OPTIONAL */
1083 int *operationStatus;
1084 #define Z_ExtendedServicesResponse_done 1
1085 #define Z_ExtendedServicesResponse_accepted 2
1086 #define Z_ExtendedServicesResponse_failure 3
1087 int num_diagnostics;
1088 Z_DiagRec **diagnostics; /* OPTIONAL */
1089 Z_External *taskPackage; /* OPTIONAL */
1090 Z_OtherInformation *otherInfo; /* OPTIONAL */
1091 } Z_ExtendedServicesResponse;
1093 /* ------------------------ Sort --------------------------- */
1095 typedef struct Z_SortAttributes
1098 Z_AttributeList *list;
1101 typedef struct Z_SortKey
1104 #define Z_SortKey_sortField 0
1105 #define Z_SortKey_elementSpec 1
1106 #define Z_SortKey_sortAttributes 2
1110 Z_Specification *elementSpec;
1111 Z_SortAttributes *sortAttributes;
1115 typedef struct Z_SortDbSpecific
1121 typedef struct Z_SortDbSpecificList
1124 Z_SortDbSpecific **dbSpecific;
1125 } Z_SortDbSpecificList;
1127 typedef struct Z_SortElement
1130 #define Z_SortElement_generic 0
1131 #define Z_SortElement_databaseSpecific 1
1135 Z_SortDbSpecificList *databaseSpecific;
1139 typedef struct Z_SortMissingValueAction
1142 #define Z_SortMissingValAct_abort 0
1143 #define Z_SortMissingValAct_null 1
1144 #define Z_SortMissingValAct_valData 2
1151 } Z_SortMissingValueAction;
1153 typedef struct Z_SortKeySpec
1155 Z_SortElement *sortElement;
1157 #define Z_SortRelation_ascending 0
1158 #define Z_SortRelation_descending 1
1159 #define Z_SortRelation_ascendingByFreq 3
1160 #define Z_SortRelation_descendingByFreq 4
1161 int *caseSensitivity;
1162 #define Z_SortCase_caseSensitive 0
1163 #define Z_SortCase_caseInsensitive 1
1164 Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
1167 typedef struct Z_SortResponse
1169 Z_ReferenceId *referenceId; /* OPTIONAL */
1171 #define Z_SortStatus_success 0
1172 #define Z_SortStatus_partial_1 1
1173 #define Z_SortStatus_failure 2
1174 int *resultSetStatus; /* OPTIONAL */
1175 #define Z_SortResultSetStatus_empty 1
1176 #define Z_SortResultSetStatus_interim 2
1177 #define Z_SortResultSetStatus_unchanged 3
1178 #define Z_SortResultSetStatus_none 4
1179 Z_DiagRecs *diagnostics; /* OPTIONAL */
1180 Z_OtherInformation *otherInfo; /* OPTIONAL */
1183 typedef struct Z_SortKeySpecList
1186 Z_SortKeySpec **specs;
1187 } Z_SortKeySpecList;
1189 typedef struct Z_SortRequest
1191 Z_ReferenceId *referenceId; /* OPTIONAL */
1192 Z_StringList *inputResultSetNames;
1193 char *sortedResultSetName;
1194 Z_SortKeySpecList *sortSequence;
1195 Z_OtherInformation *otherInfo; /* OPTIONAL */
1198 /* ----------------------- Resource Report ------------------ */
1200 typedef struct Z_ResourceReportRequest
1202 Z_ReferenceId *referenceId; /* OPTIONAL */
1203 Z_ReferenceId *opId; /* OPTIONAL */
1204 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
1205 Z_OtherInformation *otherInfo; /* OPTIONAL */
1206 } Z_ResourceReportRequest;
1208 typedef struct Z_ResourceReportResponse
1210 Z_ReferenceId *referenceId; /* OPTIONAL */
1211 int *resourceReportStatus;
1212 #define Z_ResourceReportStatus_success 0
1213 #define Z_ResourceReportStatus_partial 1
1214 #define Z_ResourceReportStatus_failure_1 2
1215 #define Z_ResourceReportStatus_failure_2 3
1216 #define Z_ResourceReportStatus_failure_3 4
1217 #define Z_ResourceReportStatus_failure_4 5
1218 #define Z_ResourceReportStatus_failure_5 6
1219 #define Z_ResourceReportStatus_failure_6 7
1220 Z_External *resourceReport; /* OPTIONAL */
1221 Z_OtherInformation *otherInfo; /* OPTIONAL */
1222 } Z_ResourceReportResponse;
1224 /* ------------------------ APDU ---------------------------- */
1226 typedef struct Z_APDU
1229 #define Z_APDU_initRequest 0
1230 #define Z_APDU_initResponse 1
1231 #define Z_APDU_searchRequest 2
1232 #define Z_APDU_searchResponse 3
1233 #define Z_APDU_presentRequest 4
1234 #define Z_APDU_presentResponse 5
1235 #define Z_APDU_deleteResultSetRequest 6
1236 #define Z_APDU_deleteResultSetResponse 7
1237 #define Z_APDU_resourceControlRequest 8
1238 #define Z_APDU_resourceControlResponse 9
1239 #define Z_APDU_triggerResourceControlRequest 10
1240 #define Z_APDU_scanRequest 11
1241 #define Z_APDU_scanResponse 12
1242 #define Z_APDU_segmentRequest 13
1243 #define Z_APDU_extendedServicesRequest 14
1244 #define Z_APDU_extendedServicesResponse 15
1245 #define Z_APDU_close 16
1246 #define Z_APDU_accessControlRequest 17
1247 #define Z_APDU_accessControlResponse 18
1248 #define Z_APDU_sortRequest 20
1249 #define Z_APDU_sortResponse 21
1250 #define Z_APDU_resourceReportRequest 22
1251 #define Z_APDU_resourceReportResponse 23
1254 Z_InitRequest *initRequest;
1255 Z_InitResponse *initResponse;
1256 Z_SearchRequest *searchRequest;
1257 Z_SearchResponse *searchResponse;
1258 Z_PresentRequest *presentRequest;
1259 Z_PresentResponse *presentResponse;
1260 Z_DeleteResultSetRequest *deleteResultSetRequest;
1261 Z_DeleteResultSetResponse *deleteResultSetResponse;
1262 Z_AccessControlRequest *accessControlRequest;
1263 Z_AccessControlResponse *accessControlResponse;
1264 Z_ResourceControlRequest *resourceControlRequest;
1265 Z_ResourceControlResponse *resourceControlResponse;
1266 Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1267 Z_ResourceReportRequest *resourceReportRequest;
1268 Z_ResourceReportResponse *resourceReportResponse;
1269 Z_ScanRequest *scanRequest;
1270 Z_ScanResponse *scanResponse;
1271 Z_SortRequest *sortRequest;
1272 Z_SortResponse *sortResponse;
1273 Z_Segment *segmentRequest;
1274 Z_ExtendedServicesRequest *extendedServicesRequest;
1275 Z_ExtendedServicesResponse *extendedServicesResponse;
1280 YAZ_EXPORT int z_APDU(ODR o, Z_APDU **p, int opt, const char *name);
1281 YAZ_EXPORT int z_SUTRS(ODR o, Odr_oct **p, int opt, const char *name);
1283 YAZ_EXPORT Z_InitRequest *zget_InitRequest(ODR o);
1284 YAZ_EXPORT Z_InitResponse *zget_InitResponse(ODR o);
1285 YAZ_EXPORT Z_SearchRequest *zget_SearchRequest(ODR o);
1286 YAZ_EXPORT Z_SearchResponse *zget_SearchResponse(ODR o);
1287 YAZ_EXPORT Z_PresentRequest *zget_PresentRequest(ODR o);
1288 YAZ_EXPORT Z_PresentResponse *zget_PresentResponse(ODR o);
1289 YAZ_EXPORT Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1290 YAZ_EXPORT Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1291 YAZ_EXPORT Z_ScanRequest *zget_ScanRequest(ODR o);
1292 YAZ_EXPORT Z_ScanResponse *zget_ScanResponse(ODR o);
1293 YAZ_EXPORT Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1294 YAZ_EXPORT Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1295 YAZ_EXPORT Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1296 YAZ_EXPORT Z_Close *zget_Close(ODR o);
1297 YAZ_EXPORT int z_StringList(ODR o, Z_StringList **p, int opt,
1299 YAZ_EXPORT int z_InternationalString(ODR o, char **p, int opt,
1301 YAZ_EXPORT int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt,
1303 YAZ_EXPORT int z_ElementSetName(ODR o, char **p, int opt, const char *name);
1304 YAZ_EXPORT int z_IntUnit(ODR o, Z_IntUnit **p, int opt, const char *name);
1305 YAZ_EXPORT int z_Unit(ODR o, Z_Unit **p, int opt, const char *name);
1306 YAZ_EXPORT int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt,
1308 YAZ_EXPORT int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt,
1310 YAZ_EXPORT int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p,
1311 int opt, const char *name);
1312 YAZ_EXPORT int z_Term(ODR o, Z_Term **p, int opt, const char *name);
1313 YAZ_EXPORT int z_Specification(ODR o, Z_Specification **p, int opt,
1315 YAZ_EXPORT int z_Permissions(ODR o, Z_Permissions **p, int opt,
1317 YAZ_EXPORT int z_DiagRec(ODR o, Z_DiagRec **p, int opt, const char *name);
1318 YAZ_EXPORT int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt, const char *name);
1319 YAZ_EXPORT int z_AttributeList(ODR o, Z_AttributeList **p, int opt,
1321 YAZ_EXPORT int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt,
1323 YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which);
1324 YAZ_EXPORT int z_Query(ODR o, Z_Query **p, int opt, const char *name);
1330 #include <prt-rsc.h>
1331 #include <prt-acc.h>
1332 #include <prt-exp.h>
1333 #include <prt-grs.h>
1334 #include <prt-arc.h>
1335 #include <prt-exd.h>
1336 #include <prt-dia.h>
1337 #include <prt-esp.h>
1338 #include <prt-add.h>
1340 #include <prt-dat.h>
1341 #include <prt-univ.h>
1342 #include <prt-ext.h>