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.46 1998-10-20 13:55:44 quinn
28 * Fixed Scan bug in asn and client
30 * Revision 1.45 1998/08/19 16:10:07 adam
31 * Changed som member names of DeleteResultSetRequest/Response.
33 * Revision 1.44 1998/05/18 10:14:08 adam
34 * Minor change - removed 'dead' definitions.
36 * Revision 1.43 1998/03/31 11:07:45 adam
37 * Furhter work on UNIverse resource report.
38 * Added Extended Services handling in frontend server.
40 * Revision 1.42 1998/03/20 14:46:06 adam
41 * Added UNIverse Resource Reports.
43 * Revision 1.41 1998/02/10 15:31:52 adam
44 * Implemented date and time structure. Changed the Update Extended
47 * Revision 1.40 1997/09/01 08:49:50 adam
48 * New windows NT/95 port using MSV5.0. To export DLL functions the
49 * YAZ_EXPORT modifier was added. Defined in yconfig.h.
51 * Revision 1.39 1997/05/14 06:53:44 adam
54 * Revision 1.38 1997/04/30 08:52:09 quinn
57 * Revision 1.37 1996/10/09 15:54:58 quinn
58 * Added SearchInfoReport
60 * Revision 1.36 1996/10/07 15:29:20 quinn
63 * Revision 1.35 1996/06/10 08:57:38 quinn
64 * Added OPAC, ResourceReport
66 * Revision 1.34 1996/06/10 08:55:36 quinn
69 * Revision 1.33 1996/02/23 10:00:51 quinn
72 * Revision 1.32 1996/02/20 12:52:39 quinn
75 * Revision 1.31 1996/01/22 09:46:45 quinn
76 * Added Sort PDU. Moved StringList to main protocol file.
78 * Revision 1.30 1996/01/10 15:21:32 quinn
79 * Added links to access control PDUs
81 * Revision 1.29 1996/01/02 11:46:49 quinn
82 * Changed 'operator' to 'roperator' to avoid C++ conflict.
85 * Revision 1.28 1996/01/02 08:57:32 quinn
86 * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
88 * Revision 1.27 1995/10/12 10:34:46 quinn
91 * Revision 1.26 1995/09/29 17:12:08 quinn
94 * Revision 1.25 1995/09/27 15:02:49 quinn
95 * Modified function heads & prototypes.
97 * Revision 1.24 1995/08/29 11:17:43 quinn
98 * *** empty log message ***
100 * Revision 1.23 1995/08/21 09:10:36 quinn
101 * Smallish fixes to suppport new formats.
103 * Revision 1.22 1995/08/17 12:45:14 quinn
104 * Fixed minor problems with GRS-1. Added support in c&s.
106 * Revision 1.21 1995/08/15 12:00:11 quinn
109 * Revision 1.20 1995/08/10 08:54:35 quinn
112 * Revision 1.19 1995/06/19 12:38:28 quinn
113 * Reorganized include-files. Added small features.
115 * Revision 1.18 1995/06/16 13:16:05 quinn
116 * Fixed Defaultdiagformat.
118 * Revision 1.17 1995/06/15 15:42:05 quinn
121 * Revision 1.16 1995/06/15 07:45:06 quinn
124 * Revision 1.15 1995/06/14 15:26:43 quinn
125 * *** empty log message ***
127 * Revision 1.14 1995/06/07 14:42:34 quinn
130 * Revision 1.13 1995/06/07 14:36:47 quinn
133 * Revision 1.12 1995/06/05 10:53:13 quinn
136 * Revision 1.11 1995/06/02 09:49:47 quinn
139 * Revision 1.10 1995/05/29 08:11:34 quinn
140 * Moved oid from odr/asn to util.
142 * Revision 1.9 1995/05/22 11:31:25 quinn
145 * Revision 1.8 1995/05/17 08:41:35 quinn
146 * Added delete to proto & other little things.
147 * Relaying auth info to backend.
149 * Revision 1.7 1995/05/16 08:50:37 quinn
150 * License, documentation, and memory fixes
152 * Revision 1.6 1995/05/15 11:55:55 quinn
153 * Work on asynchronous activity.
155 * Revision 1.5 1995/04/17 11:28:18 quinn
158 * Revision 1.4 1995/04/10 10:22:47 quinn
161 * Revision 1.3 1995/03/30 12:18:09 quinn
164 * Revision 1.2 1995/03/30 10:26:48 quinn
165 * Added Term structure
167 * Revision 1.1 1995/03/30 09:39:42 quinn
168 * Moved .h files to include directory
170 * Revision 1.11 1995/03/30 09:08:44 quinn
171 * Added Resource control protocol
173 * Revision 1.10 1995/03/29 15:39:39 quinn
174 * Adding some resource control elements, and a null-check to getentbyoid
176 * Revision 1.9 1995/03/29 08:06:18 quinn
177 * Added a few v3 elements
179 * Revision 1.8 1995/03/22 10:12:49 quinn
180 * Added Z_PRES constants.
182 * Revision 1.7 1995/03/20 09:45:12 quinn
185 * Revision 1.5 1995/03/07 16:29:34 quinn
186 * Added authentication stuff.
188 * Revision 1.4 1995/03/07 10:13:00 quinn
189 * Added prototype for z_APDU()
191 * Revision 1.3 1995/02/14 11:54:23 quinn
194 * Revision 1.2 1995/02/09 15:51:40 quinn
197 * Revision 1.1 1995/02/06 16:44:48 quinn
198 * First hack at Z/SR protocol
209 #include <yaz-version.h>
216 * Because we didn't have time to put all of the extra v3 elements in here
217 * before the first applications were written, we have to place them
218 * in #ifdefs in places where they would break existing code. If you are
219 * developing new stuff, we urge you to leave them in, even if you don't
220 * intend to use any v3 features. When we are comfortable that the old
221 * apps have been updated, we'll remove the #ifdefs.
226 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
229 typedef struct Z_External Z_External;
231 typedef Odr_oct Z_ReferenceId;
232 typedef char Z_DatabaseName;
233 typedef char Z_ResultSetId;
234 typedef Odr_oct Z_ResultsetId;
236 typedef struct Z_InfoCategory
238 Odr_oid *categoryTypeId; /* OPTIONAL */
242 typedef struct Z_OtherInformationUnit
244 Z_InfoCategory *category; /* OPTIONAL */
246 #define Z_OtherInfo_characterInfo 0
247 #define Z_OtherInfo_binaryInfo 1
248 #define Z_OtherInfo_externallyDefinedInfo 2
249 #define Z_OtherInfo_oid 3
254 Z_External *externallyDefinedInfo;
257 } Z_OtherInformationUnit;
259 typedef struct Z_OtherInformation
262 Z_OtherInformationUnit **list;
263 } Z_OtherInformation;
265 typedef struct Z_StringOrNumeric
268 #define Z_StringOrNumeric_string 0
269 #define Z_StringOrNumeric_numeric 1
277 typedef struct Z_Unit
279 char *unitSystem; /* OPTIONAL */
280 Z_StringOrNumeric *unitType; /* OPTIONAL */
281 Z_StringOrNumeric *unit; /* OPTIONAL */
282 int *scaleFactor; /* OPTIONAL */
285 typedef struct Z_IntUnit
291 typedef Odr_oct Z_SUTRS;
293 typedef struct Z_StringList
299 /* ----------------- INIT SERVICE ----------------*/
303 char *groupId; /* OPTIONAL */
304 char *userId; /* OPTIONAL */
305 char *password; /* OPTIONAL */
308 typedef struct Z_IdAuthentication
311 #define Z_IdAuthentication_open 0
312 #define Z_IdAuthentication_idPass 1
313 #define Z_IdAuthentication_anonymous 2
314 #define Z_IdAuthentication_other 3
322 } Z_IdAuthentication;
324 #define Z_ProtocolVersion_1 0
325 #define Z_ProtocolVersion_2 1
326 #define Z_ProtocolVersion_3 2
328 #define Z_Options_search 0
329 #define Z_Options_present 1
330 #define Z_Options_delSet 2
331 #define Z_Options_resourceReport 3
332 #define Z_Options_triggerResourceCtrl 4
333 #define Z_Options_resourceCtrl 5
334 #define Z_Options_accessCtrl 6
335 #define Z_Options_scan 7
336 #define Z_Options_sort 8
337 #define Z_Options_reserved 9
338 #define Z_Options_extendedServices 10
339 #define Z_Options_level_1Segmentation 11
340 #define Z_Options_level_2Segmentation 12
341 #define Z_Options_concurrentOperations 13
342 #define Z_Options_namedResultSets 14
344 typedef struct Z_InitRequest
346 Z_ReferenceId *referenceId; /* OPTIONAL */
347 Odr_bitmask *protocolVersion;
348 Odr_bitmask *options;
349 int *preferredMessageSize;
350 int *maximumRecordSize;
351 Z_IdAuthentication* idAuthentication; /* OPTIONAL */
352 char *implementationId; /* OPTIONAL */
353 char *implementationName; /* OPTIONAL */
354 char *implementationVersion; /* OPTIONAL */
355 Z_External *userInformationField; /* OPTIONAL */
357 Z_OtherInformation *otherInfo; /* OPTIONAL */
361 typedef struct Z_InitResponse
363 Z_ReferenceId *referenceId; /* OPTIONAL */
364 Odr_bitmask *protocolVersion;
365 Odr_bitmask *options;
366 int *preferredMessageSize;
367 int *maximumRecordSize;
369 char *implementationId; /* OPTIONAL */
370 char *implementationName; /* OPTIONAL */
371 char *implementationVersion; /* OPTIONAL */
372 Z_External *userInformationField; /* OPTIONAL */
374 Z_OtherInformation *otherInfo; /* OPTIONAL */
378 typedef struct Z_NSRAuthentication
383 } Z_NSRAuthentication;
385 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
387 int z_StrAuthentication(ODR o, char **p, int opt);
389 /* ------------------ SEARCH SERVICE ----------------*/
391 typedef struct Z_DatabaseSpecificUnit
394 char *elementSetName;
395 } Z_DatabaseSpecificUnit;
397 typedef struct Z_DatabaseSpecific
400 Z_DatabaseSpecificUnit **elements;
401 } Z_DatabaseSpecific;
403 typedef struct Z_ElementSetNames
406 #define Z_ElementSetNames_generic 0
407 #define Z_ElementSetNames_databaseSpecific 1
411 Z_DatabaseSpecific *databaseSpecific;
415 /* ---------------------- RPN QUERY --------------------------- */
417 typedef struct Z_ComplexAttribute
420 Z_StringOrNumeric **list;
421 int num_semanticAction;
422 int **semanticAction; /* OPTIONAL */
423 } Z_ComplexAttribute;
425 typedef struct Z_AttributeElement
428 Odr_oid *attributeSet; /* OPTIONAL - v3 only */
433 #define Z_AttributeValue_numeric 0
434 #define Z_AttributeValue_complex 1
438 Z_ComplexAttribute *complex;
443 } Z_AttributeElement;
445 typedef struct Z_Term
448 #define Z_Term_general 0
449 #define Z_Term_numeric 1
450 #define Z_Term_characterString 2
452 #define Z_Term_dateTime 4
453 #define Z_Term_external 5
454 #define Z_Term_integerAndUnit 6
455 #define Z_Term_null 7
458 Odr_oct *general; /* this is required for v2 */
460 char *characterString;
463 Z_External *external;
464 /* Z_IntUnit *integerAndUnit; */
469 typedef struct Z_AttributesPlusTerm
472 Z_AttributeElement **attributeList;
474 } Z_AttributesPlusTerm;
476 typedef struct Z_ResultSetPlusAttributes
480 Z_AttributeElement **attributeList;
481 } Z_ResultSetPlusAttributes;
483 typedef struct Z_ProximityOperator
485 bool_t *exclusion; /* OPTIONAL */
489 #define Z_Prox_lessThan 1
490 #define Z_Prox_lessThanOrEqual 2
491 #define Z_Prox_equal 3
492 #define Z_Prox_greaterThanOrEqual 4
493 #define Z_Prox_greaterThan 5
494 #define Z_Prox_notEqual 6
496 #define Z_ProxCode_known 0
497 #define Z_ProxCode_private 1
498 int *proximityUnitCode;
499 #define Z_ProxUnit_character 1
500 #define Z_ProxUnit_word 2
501 #define Z_ProxUnit_sentence 3
502 #define Z_ProxUnit_paragraph 4
503 #define Z_ProxUnit_section 5
504 #define Z_ProxUnit_chapter 6
505 #define Z_ProxUnit_document 7
506 #define Z_ProxUnit_element 8
507 #define Z_ProxUnit_subelement 9
508 #define Z_ProxUnit_elementType 10
509 #define Z_ProxUnit_byte 11 /* v3 only */
510 } Z_ProximityOperator;
512 typedef struct Z_Operator
515 #define Z_Operator_and 0
516 #define Z_Operator_or 1
517 #define Z_Operator_and_not 2
518 #define Z_Operator_prox 3
521 Odr_null *and; /* these guys are nulls. */
524 Z_ProximityOperator *prox;
528 typedef struct Z_Operand
531 #define Z_Operand_APT 0
532 #define Z_Operand_resultSetId 1
533 #define Z_Operand_resultAttr /* v3 only */ 2
536 Z_AttributesPlusTerm *attributesPlusTerm;
537 Z_ResultSetId *resultSetId;
538 Z_ResultSetPlusAttributes *resultAttr;
542 typedef struct Z_Complex
544 struct Z_RPNStructure *s1;
545 struct Z_RPNStructure *s2;
546 Z_Operator *roperator;
549 typedef struct Z_RPNStructure
552 #define Z_RPNStructure_simple 0
553 #define Z_RPNStructure_complex 1
561 typedef struct Z_RPNQuery
563 Odr_oid *attributeSetId;
564 Z_RPNStructure *RPNStructure;
567 /* -------------------------- SEARCHREQUEST -------------------------- */
569 typedef struct Z_Query
572 #define Z_Query_type_1 1
573 #define Z_Query_type_2 2
574 #define Z_Query_type_101 3
579 Z_RPNQuery *type_101;
583 typedef struct Z_SearchRequest
585 Z_ReferenceId *referenceId; /* OPTIONAL */
586 int *smallSetUpperBound;
587 int *largeSetLowerBound;
588 int *mediumSetPresentNumber;
589 bool_t *replaceIndicator;
591 int num_databaseNames;
592 char **databaseNames;
593 Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */
594 Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */
595 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
598 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */
599 Z_OtherInformation *otherInfo; /* OPTIONAL */
603 /* ------------------------ RECORD -------------------------- */
605 typedef Z_External Z_DatabaseRecord;
609 typedef struct Z_DefaultDiagFormat
611 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
613 /* until the whole character set issue becomes more definite,
614 * you can probably ignore this on input. */
616 #define Z_DiagForm_v2AddInfo 0
617 #define Z_DiagForm_v3AddInfo 1
619 } Z_DefaultDiagFormat;
621 typedef struct Z_DiagRec
624 #define Z_DiagRec_defaultFormat 0
625 #define Z_DiagRec_externallyDefined 1
628 Z_DefaultDiagFormat *defaultFormat;
629 Z_External *externallyDefined;
635 typedef struct Z_DiagRec
637 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
644 typedef struct Z_DiagRecs
647 Z_DiagRec **diagRecs;
650 typedef struct Z_NamePlusRecord
652 char *databaseName; /* OPTIONAL */
654 #define Z_NamePlusRecord_databaseRecord 0
655 #define Z_NamePlusRecord_surrogateDiagnostic 1
658 Z_DatabaseRecord *databaseRecord;
659 Z_DiagRec *surrogateDiagnostic;
663 typedef struct Z_NamePlusRecordList
666 Z_NamePlusRecord **records;
667 } Z_NamePlusRecordList;
669 typedef struct Z_Records
672 #define Z_Records_DBOSD 0
673 #define Z_Records_NSD 1
674 #define Z_Records_multipleNSD 2
677 Z_NamePlusRecordList *databaseOrSurDiagnostics;
678 Z_DiagRec *nonSurrogateDiagnostic;
679 Z_DiagRecs *multipleNonSurDiagnostics;
683 /* ------------------------ SEARCHRESPONSE ------------------ */
685 typedef struct Z_SearchResponse
687 Z_ReferenceId *referenceId; /* OPTIONAL */
689 int *numberOfRecordsReturned;
690 int *nextResultSetPosition;
691 bool_t *searchStatus;
692 int *resultSetStatus; /* OPTIONAL */
693 #define Z_RES_SUBSET 1
694 #define Z_RES_INTERIM 2
696 int *presentStatus; /* OPTIONAL */
697 #define Z_PRES_SUCCESS 0
698 #define Z_PRES_PARTIAL_1 1
699 #define Z_PRES_PARTIAL_2 2
700 #define Z_PRES_PARTIAL_3 3
701 #define Z_PRES_PARTIAL_4 4
702 #define Z_PRES_FAILURE 5
703 Z_Records *records; /* OPTIONAL */
705 Z_OtherInformation *additionalSearchInfo;
706 Z_OtherInformation *otherInfo;
710 /* ------------------------- PRESENT SERVICE -----------------*/
712 typedef struct Z_ElementSpec
715 #define Z_ElementSpec_elementSetName 0
716 #define Z_ElementSpec_externalSpec 1
719 char *elementSetName;
720 Z_External *externalSpec;
724 typedef struct Z_Specification
726 Odr_oid *schema; /* OPTIONAL */
727 Z_ElementSpec *elementSpec; /* OPTIONAL */
730 typedef struct Z_DbSpecific
733 Z_Specification *spec;
736 typedef struct Z_CompSpec
738 bool_t *selectAlternativeSyntax;
739 Z_Specification *generic; /* OPTIONAL */
741 Z_DbSpecific **dbSpecific; /* OPTIONAL */
742 int num_recordSyntax;
743 Odr_oid **recordSyntax; /* OPTIONAL */
746 typedef struct Z_RecordComposition
749 #define Z_RecordComp_simple 0
750 #define Z_RecordComp_complex 1
753 Z_ElementSetNames *simple;
756 } Z_RecordComposition;
758 typedef struct Z_Range
760 int *startingPosition;
761 int *numberOfRecords;
764 typedef struct Z_PresentRequest
766 Z_ReferenceId *referenceId; /* OPTIONAL */
767 Z_ResultSetId *resultSetId;
768 int *resultSetStartPoint;
769 int *numberOfRecordsRequested;
772 Z_Range **additionalRanges; /* OPTIONAL */
773 Z_RecordComposition *recordComposition; /* OPTIONAL */
775 Z_ElementSetNames *elementSetNames; /* OPTIONAL */
777 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
779 int *maxSegmentCount; /* OPTIONAL */
780 int *maxRecordSize; /* OPTIONAL */
781 int *maxSegmentSize; /* OPTIONAL */
782 Z_OtherInformation *otherInfo; /* OPTIONAL */
786 typedef struct Z_PresentResponse
788 Z_ReferenceId *referenceId; /* OPTIONAL */
789 int *numberOfRecordsReturned;
790 int *nextResultSetPosition;
794 Z_OtherInformation *otherInfo; /* OPTIONAL */
798 /* ------------------ RESOURCE CONTROL ----------------*/
800 typedef struct Z_TriggerResourceControlRequest
802 Z_ReferenceId *referenceId; /* OPTIONAL */
803 int *requestedAction;
804 #define Z_TriggerResourceCtrl_resourceReport 1
805 #define Z_TriggerResourceCtrl_resourceControl 2
806 #define Z_TriggerResourceCtrl_cancel 3
807 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
808 bool_t *resultSetWanted; /* OPTIONAL */
810 Z_OtherInformation *otherInfo;
812 } Z_TriggerResourceControlRequest;
814 typedef struct Z_ResourceControlRequest
816 Z_ReferenceId *referenceId; /* OPTIONAL */
817 bool_t *suspendedFlag; /* OPTIONAL */
818 Z_External *resourceReport; /* OPTIONAL */
819 int *partialResultsAvailable; /* OPTIONAL */
820 #define Z_ResourceControlRequest_subset 1
821 #define Z_ResourceControlRequest_interim 2
822 #define Z_ResourceControlRequest_none 3
823 bool_t *responseRequired;
824 bool_t *triggeredRequestFlag; /* OPTIONAL */
826 Z_OtherInformation *otherInfo;
828 } Z_ResourceControlRequest;
830 typedef struct Z_ResourceControlResponse
832 Z_ReferenceId *referenceId; /* OPTIONAL */
833 bool_t *continueFlag;
834 bool_t *resultSetWanted; /* OPTIONAL */
836 Z_OtherInformation *otherInfo;
838 } Z_ResourceControlResponse;
841 /* ------------------ ACCESS CTRL SERVICE ----------------*/
843 typedef struct Z_AccessControlRequest
845 Z_ReferenceId *referenceId; /* OPTIONAL */
847 #define Z_AccessRequest_simpleForm 0
848 #define Z_AccessRequest_externallyDefined 1
852 Z_External *externallyDefined;
855 Z_OtherInformation *otherInfo; /* OPTIONAL */
857 } Z_AccessControlRequest;
859 typedef struct Z_AccessControlResponse
861 Z_ReferenceId *referenceId; /* OPTIONAL */
863 #define Z_AccessResponse_simpleForm 0
864 #define Z_AccessResponse_externallyDefined 1
868 Z_External *externallyDefined;
870 Z_DiagRec *diagnostic; /* OPTIONAL */
872 Z_OtherInformation *otherInfo; /* OPTIONAL */
874 } Z_AccessControlResponse;
876 /* ------------------------ SCAN SERVICE -------------------- */
878 typedef struct Z_AttributeList
881 Z_AttributeElement **attributes;
884 typedef struct Z_AlternativeTerm
887 Z_AttributesPlusTerm **terms;
890 typedef struct Z_ByDatabase
893 int *num; /* OPTIONAL */
894 Z_OtherInformation *otherDbInfo; /* OPTIONAL */
897 typedef struct Z_ByDatabaseList
900 Z_ByDatabase **elements;
903 typedef struct Z_ScanOccurrences
906 #define Z_ScanOccurrences_global 0
907 #define Z_ScanOccurrences_byDatabase 1
911 Z_ByDatabaseList *byDatabase;
916 typedef struct Z_OccurrenceByAttributesElem
918 Z_AttributeList *attributes;
919 Z_ScanOccurrences *occurrences; /* OPTIONAL */
920 Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
921 } Z_OccurrenceByAttributesElem;
923 typedef struct Z_OccurrenceByAttributes
926 Z_OccurrenceByAttributesElem **elements;
927 } Z_OccurrenceByAttributes;
929 typedef struct Z_TermInfo
932 char *displayTerm; /* OPTIONAL */
933 Z_AttributeList *suggestedAttributes; /* OPTIONAL */
934 Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
935 int *globalOccurrences; /* OPTIONAL */
936 Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
937 Z_OtherInformation *otherTermInfo; /* OPTIONAL */
940 typedef struct Z_Entry
943 #define Z_Entry_termInfo 0
944 #define Z_Entry_surrogateDiagnostic 1
947 Z_TermInfo *termInfo;
948 Z_DiagRec *surrogateDiagnostic;
952 #ifdef BUGGY_LISTENTRIES
954 typedef struct Z_Entries
960 typedef struct Z_ListEntries
963 #define Z_ListEntries_entries 0
964 #define Z_ListEntries_nonSurrogateDiagnostics 1
968 Z_DiagRecs *nonSurrogateDiagnostics;
974 typedef struct Z_ListEntries {
976 Z_Entry **entries; /* OPT */
977 int num_nonsurrogateDiagnostics;
978 Z_DiagRec **nonsurrogateDiagnostics; /* OPT */
981 typedef struct Z_ScanRequest
983 Z_ReferenceId *referenceId; /* OPTIONAL */
984 int num_databaseNames;
985 char **databaseNames;
986 Odr_oid *attributeSet; /* OPTIONAL */
987 Z_AttributesPlusTerm *termListAndStartPoint;
988 int *stepSize; /* OPTIONAL */
989 int *numberOfTermsRequested;
990 int *preferredPositionInResponse; /* OPTIONAL */
992 Z_OtherInformation *otherInfo;
996 typedef struct Z_ScanResponse
998 Z_ReferenceId *referenceId; /* OPTIONAL */
999 int *stepSize; /* OPTIONAL */
1001 #define Z_Scan_success 0
1002 #define Z_Scan_partial_1 1
1003 #define Z_Scan_partial_2 2
1004 #define Z_Scan_partial_3 3
1005 #define Z_Scan_partial_4 4
1006 #define Z_Scan_partial_5 5
1007 #define Z_Scan_failure 6
1008 int *numberOfEntriesReturned;
1009 int *positionOfTerm; /* OPTIONAL */
1010 Z_ListEntries *entries; /* OPTIONAL */
1011 Odr_oid *attributeSet; /* OPTIONAL */
1013 Z_OtherInformation *otherInfo;
1018 /* ------------------------ DELETE -------------------------- */
1020 #define Z_DeleteStatus_success 0
1021 #define Z_DeleteStatus_resultSetDidNotExist 1
1022 #define Z_DeleteStatus_previouslyDeletedByTarget 2
1023 #define Z_DeleteStatus_systemProblemAtTarget 3
1024 #define Z_DeleteStatus_accessNotAllowed 4
1025 #define Z_DeleteStatus_resourceControlAtOrigin 5
1026 #define Z_DeleteStatus_resourceControlAtTarget 6
1027 #define Z_DeleteStatus_bulkDeleteNotSupported 7
1028 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
1029 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
1030 #define Z_DeleteStatus_resultSetInUse 10
1032 typedef struct Z_ListStatus
1038 typedef struct Z_DeleteResultSetRequest
1040 Z_ReferenceId *referenceId; /* OPTIONAL */
1041 int *deleteFunction;
1042 #define Z_DeleteRequest_list 0
1043 #define Z_DeleteRequest_all 1
1044 int num_resultSetList;
1045 Z_ResultSetId **resultSetList; /* OPTIONAL */
1047 Z_OtherInformation *otherInfo;
1049 } Z_DeleteResultSetRequest;
1051 typedef struct Z_ListStatuses {
1053 Z_ListStatus **elements;
1056 typedef struct Z_DeleteResultSetResponse
1058 Z_ReferenceId *referenceId; /* OPTIONAL */
1059 int *deleteOperationStatus;
1060 Z_ListStatuses *deleteListStatuses;/* OPTIONAL */
1061 int *numberNotDeleted; /* OPTIONAL */
1062 Z_ListStatuses *bulkStatuses; /* OPTIONAL */
1063 char *deleteMessage; /* OPTIONAL */
1065 Z_OtherInformation *otherInfo;
1067 } Z_DeleteResultSetResponse;
1069 /* ------------------------ CLOSE SERVICE ------------------- */
1071 typedef struct Z_Close
1073 Z_ReferenceId *referenceId; /* OPTIONAL */
1075 #define Z_Close_finished 0
1076 #define Z_Close_shutdown 1
1077 #define Z_Close_systemProblem 2
1078 #define Z_Close_costLimit 3
1079 #define Z_Close_resources 4
1080 #define Z_Close_securityViolation 5
1081 #define Z_Close_protocolError 6
1082 #define Z_Close_lackOfActivity 7
1083 #define Z_Close_peerAbort 8
1084 #define Z_Close_unspecified 9
1085 char *diagnosticInformation; /* OPTIONAL */
1086 Odr_oid *resourceReportFormat; /* OPTIONAL */
1087 Z_External *resourceReport; /* OPTIONAL */
1089 Z_OtherInformation *otherInfo; /* OPTIONAL */
1093 /* ------------------------ SEGMENTATION -------------------- */
1095 typedef struct Z_Segment
1097 Z_ReferenceId *referenceId; /* OPTIONAL */
1098 int *numberOfRecordsReturned;
1099 int num_segmentRecords;
1100 Z_NamePlusRecord **segmentRecords;
1101 Z_OtherInformation *otherInfo; /* OPTIONAL */
1104 /* ----------------------- Extended Services ---------------- */
1106 typedef struct Z_Permissions
1109 int num_allowableFunctions;
1110 int **allowableFunctions;
1111 #define Z_Permissions_delete 1
1112 #define Z_Permissions_modifyContents 2
1113 #define Z_Permissions_modifyPermissions 3
1114 #define Z_Permissions_present 4
1115 #define Z_Permissions_invoke 5
1118 typedef struct Z_ExtendedServicesRequest
1120 Z_ReferenceId *referenceId; /* OPTIONAL */
1122 #define Z_ExtendedServicesRequest_create 1
1123 #define Z_ExtendedServicesRequest_delete 2
1124 #define Z_ExtendedServicesRequest_modify 3
1125 Odr_oid *packageType;
1126 char *packageName; /* OPTIONAL */
1127 char *userId; /* OPTIONAL */
1128 Z_IntUnit *retentionTime; /* OPTIONAL */
1129 Z_Permissions *permissions; /* OPTIONAL */
1130 char *description; /* OPTIONAL */
1131 Z_External *taskSpecificParameters; /* OPTIONAL */
1133 #define Z_ExtendedServicesRequest_wait 1
1134 #define Z_ExtendedServicesRequest_waitIfPossible 2
1135 #define Z_ExtendedServicesRequest_dontWait 3
1136 #define Z_ExtendedServicesRequest_dontReturnPackage 4
1137 char *elements; /* OPTIONAL */
1138 Z_OtherInformation *otherInfo; /* OPTIONAL */
1139 } Z_ExtendedServicesRequest;
1141 typedef struct Z_ExtendedServicesResponse
1143 Z_ReferenceId *referenceId; /* OPTIONAL */
1144 int *operationStatus;
1145 #define Z_ExtendedServicesResponse_done 1
1146 #define Z_ExtendedServicesResponse_accepted 2
1147 #define Z_ExtendedServicesResponse_failure 3
1148 int num_diagnostics;
1149 Z_DiagRec **diagnostics; /* OPTIONAL */
1150 Z_External *taskPackage; /* OPTIONAL */
1151 Z_OtherInformation *otherInfo; /* OPTIONAL */
1152 } Z_ExtendedServicesResponse;
1154 /* ------------------------ Sort --------------------------- */
1156 typedef struct Z_SortAttributes
1159 Z_AttributeList *list;
1162 typedef struct Z_SortKey
1165 #define Z_SortKey_sortField 0
1166 #define Z_SortKey_elementSpec 1
1167 #define Z_SortKey_sortAttributes 2
1171 Z_Specification *elementSpec;
1172 Z_SortAttributes *sortAttributes;
1176 typedef struct Z_SortDbSpecific
1182 typedef struct Z_SortDbSpecificList
1185 Z_SortDbSpecific **dbSpecific;
1186 } Z_SortDbSpecificList;
1188 typedef struct Z_SortElement
1191 #define Z_SortElement_generic 0
1192 #define Z_SortElement_databaseSpecific 1
1196 Z_SortDbSpecificList *databaseSpecific;
1200 typedef struct Z_SortMissingValueAction
1203 #define Z_SortMissingValAct_abort 0
1204 #define Z_SortMissingValAct_null 1
1205 #define Z_SortMissingValAct_valData 2
1212 } Z_SortMissingValueAction;
1214 typedef struct Z_SortKeySpec
1216 Z_SortElement *sortElement;
1218 #define Z_SortRelation_ascending 0
1219 #define Z_SortRelation_descending 1
1220 #define Z_SortRelation_ascendingByFreq 3
1221 #define Z_SortRelation_descendingByFreq 4
1222 int *caseSensitivity;
1223 #define Z_SortCase_caseSensitive 0
1224 #define Z_SortCase_caseInsensitive 1
1225 Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
1228 typedef struct Z_SortResponse
1230 Z_ReferenceId *referenceId; /* OPTIONAL */
1232 #define Z_SortStatus_success 0
1233 #define Z_SortStatus_partial_1 1
1234 #define Z_SortStatus_failure 2
1235 int *resultSetStatus; /* OPTIONAL */
1236 #define Z_SortResultSetStatus_empty 1
1237 #define Z_SortResultSetStatus_interim 2
1238 #define Z_SortResultSetStatus_unchanged 3
1239 #define Z_SortResultSetStatus_none 4
1240 Z_DiagRecs *diagnostics; /* OPTIONAL */
1241 Z_OtherInformation *otherInfo; /* OPTIONAL */
1244 typedef struct Z_SortKeySpecList
1247 Z_SortKeySpec **specs;
1248 } Z_SortKeySpecList;
1250 typedef struct Z_SortRequest
1252 Z_ReferenceId *referenceId; /* OPTIONAL */
1253 Z_StringList *inputResultSetNames;
1254 char *sortedResultSetName;
1255 Z_SortKeySpecList *sortSequence;
1256 Z_OtherInformation *otherInfo; /* OPTIONAL */
1259 /* ----------------------- Resource Report ------------------ */
1261 typedef struct Z_ResourceReportRequest
1263 Z_ReferenceId *referenceId; /* OPTIONAL */
1264 Z_ReferenceId *opId; /* OPTIONAL */
1265 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
1266 Z_OtherInformation *otherInfo; /* OPTIONAL */
1267 } Z_ResourceReportRequest;
1269 typedef struct Z_ResourceReportResponse
1271 Z_ReferenceId *referenceId; /* OPTIONAL */
1272 int *resourceReportStatus;
1273 #define Z_ResourceReportStatus_success 0
1274 #define Z_ResourceReportStatus_partial 1
1275 #define Z_ResourceReportStatus_failure_1 2
1276 #define Z_ResourceReportStatus_failure_2 3
1277 #define Z_ResourceReportStatus_failure_3 4
1278 #define Z_ResourceReportStatus_failure_4 5
1279 #define Z_ResourceReportStatus_failure_5 6
1280 #define Z_ResourceReportStatus_failure_6 7
1281 Z_External *resourceReport; /* OPTIONAL */
1282 Z_OtherInformation *otherInfo; /* OPTIONAL */
1283 } Z_ResourceReportResponse;
1285 /* ------------------------ APDU ---------------------------- */
1287 typedef struct Z_APDU
1290 #define Z_APDU_initRequest 0
1291 #define Z_APDU_initResponse 1
1292 #define Z_APDU_searchRequest 2
1293 #define Z_APDU_searchResponse 3
1294 #define Z_APDU_presentRequest 4
1295 #define Z_APDU_presentResponse 5
1296 #define Z_APDU_deleteResultSetRequest 6
1297 #define Z_APDU_deleteResultSetResponse 7
1298 #define Z_APDU_resourceControlRequest 8
1299 #define Z_APDU_resourceControlResponse 9
1300 #define Z_APDU_triggerResourceControlRequest 10
1301 #define Z_APDU_scanRequest 11
1302 #define Z_APDU_scanResponse 12
1303 #define Z_APDU_segmentRequest 13
1304 #define Z_APDU_extendedServicesRequest 14
1305 #define Z_APDU_extendedServicesResponse 15
1306 #define Z_APDU_close 16
1307 #define Z_APDU_accessControlRequest 17
1308 #define Z_APDU_accessControlResponse 18
1309 #define Z_APDU_sortRequest 20
1310 #define Z_APDU_sortResponse 21
1311 #define Z_APDU_resourceReportRequest 22
1312 #define Z_APDU_resourceReportResponse 23
1315 Z_InitRequest *initRequest;
1316 Z_InitResponse *initResponse;
1317 Z_SearchRequest *searchRequest;
1318 Z_SearchResponse *searchResponse;
1319 Z_PresentRequest *presentRequest;
1320 Z_PresentResponse *presentResponse;
1321 Z_DeleteResultSetRequest *deleteResultSetRequest;
1322 Z_DeleteResultSetResponse *deleteResultSetResponse;
1323 Z_AccessControlRequest *accessControlRequest;
1324 Z_AccessControlResponse *accessControlResponse;
1325 Z_ResourceControlRequest *resourceControlRequest;
1326 Z_ResourceControlResponse *resourceControlResponse;
1327 Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1328 Z_ResourceReportRequest *resourceReportRequest;
1329 Z_ResourceReportResponse *resourceReportResponse;
1330 Z_ScanRequest *scanRequest;
1331 Z_ScanResponse *scanResponse;
1332 Z_SortRequest *sortRequest;
1333 Z_SortResponse *sortResponse;
1334 Z_Segment *segmentRequest;
1335 Z_ExtendedServicesRequest *extendedServicesRequest;
1336 Z_ExtendedServicesResponse *extendedServicesResponse;
1341 YAZ_EXPORT int z_APDU(ODR o, Z_APDU **p, int opt);
1342 YAZ_EXPORT int z_SUTRS(ODR o, Odr_oct **p, int opt);
1344 YAZ_EXPORT Z_InitRequest *zget_InitRequest(ODR o);
1345 YAZ_EXPORT Z_InitResponse *zget_InitResponse(ODR o);
1346 YAZ_EXPORT Z_SearchRequest *zget_SearchRequest(ODR o);
1347 YAZ_EXPORT Z_SearchResponse *zget_SearchResponse(ODR o);
1348 YAZ_EXPORT Z_PresentRequest *zget_PresentRequest(ODR o);
1349 YAZ_EXPORT Z_PresentResponse *zget_PresentResponse(ODR o);
1350 YAZ_EXPORT Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1351 YAZ_EXPORT Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1352 YAZ_EXPORT Z_ScanRequest *zget_ScanRequest(ODR o);
1353 YAZ_EXPORT Z_ScanResponse *zget_ScanResponse(ODR o);
1354 YAZ_EXPORT Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1355 YAZ_EXPORT Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1356 YAZ_EXPORT Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1357 YAZ_EXPORT Z_Close *zget_Close(ODR o);
1358 YAZ_EXPORT int z_StringList(ODR o, Z_StringList **p, int opt);
1359 YAZ_EXPORT int z_InternationalString(ODR o, char **p, int opt);
1360 YAZ_EXPORT int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt);
1361 YAZ_EXPORT int z_ElementSetName(ODR o, char **p, int opt);
1362 YAZ_EXPORT int z_IntUnit(ODR o, Z_IntUnit **p, int opt);
1363 YAZ_EXPORT int z_Unit(ODR o, Z_Unit **p, int opt);
1364 YAZ_EXPORT int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt);
1365 YAZ_EXPORT int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt);
1366 YAZ_EXPORT int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt);
1367 YAZ_EXPORT int z_Term(ODR o, Z_Term **p, int opt);
1368 YAZ_EXPORT int z_Specification(ODR o, Z_Specification **p, int opt);
1369 YAZ_EXPORT int z_Permissions(ODR o, Z_Permissions **p, int opt);
1370 YAZ_EXPORT int z_DiagRec(ODR o, Z_DiagRec **p, int opt);
1371 YAZ_EXPORT int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt);
1372 YAZ_EXPORT int z_AttributeList(ODR o, Z_AttributeList **p, int opt);
1373 YAZ_EXPORT int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt);
1374 YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which);
1375 YAZ_EXPORT int z_Query(ODR o, Z_Query **p, int opt);
1381 #include <prt-rsc.h>
1382 #include <prt-acc.h>
1383 #include <prt-exp.h>
1384 #include <prt-grs.h>
1385 #include <prt-arc.h>
1386 #include <prt-exd.h>
1387 #include <prt-dia.h>
1388 #include <prt-esp.h>
1389 #include <prt-add.h>
1391 #include <prt-dat.h>
1392 #include <prt-univ.h>
1393 #include <prt-ext.h>