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
26 * $Id: prt-proto.h,v 1.1 1999-11-30 13:47:11 adam Exp $
32 #include <yaz/yconfig.h>
35 #include <yaz/yaz-version.h>
41 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
44 typedef struct Z_External Z_External;
46 typedef Odr_oct Z_ReferenceId;
47 typedef char Z_DatabaseName;
48 typedef char Z_ResultSetId;
49 typedef Odr_oct Z_ResultsetId;
51 typedef struct Z_InfoCategory
53 Odr_oid *categoryTypeId; /* OPTIONAL */
57 typedef struct Z_OtherInformationUnit
59 Z_InfoCategory *category; /* OPTIONAL */
61 #define Z_OtherInfo_characterInfo 0
62 #define Z_OtherInfo_binaryInfo 1
63 #define Z_OtherInfo_externallyDefinedInfo 2
64 #define Z_OtherInfo_oid 3
69 Z_External *externallyDefinedInfo;
72 } Z_OtherInformationUnit;
74 typedef struct Z_OtherInformation
77 Z_OtherInformationUnit **list;
80 typedef struct Z_StringOrNumeric
83 #define Z_StringOrNumeric_string 0
84 #define Z_StringOrNumeric_numeric 1
94 char *unitSystem; /* OPTIONAL */
95 Z_StringOrNumeric *unitType; /* OPTIONAL */
96 Z_StringOrNumeric *unit; /* OPTIONAL */
97 int *scaleFactor; /* OPTIONAL */
100 typedef struct Z_IntUnit
106 typedef Odr_oct Z_SUTRS;
108 typedef struct Z_StringList
114 /* ----------------- INIT SERVICE ----------------*/
118 char *groupId; /* OPTIONAL */
119 char *userId; /* OPTIONAL */
120 char *password; /* OPTIONAL */
123 typedef struct Z_IdAuthentication
126 #define Z_IdAuthentication_open 0
127 #define Z_IdAuthentication_idPass 1
128 #define Z_IdAuthentication_anonymous 2
129 #define Z_IdAuthentication_other 3
137 } Z_IdAuthentication;
139 #define Z_ProtocolVersion_1 0
140 #define Z_ProtocolVersion_2 1
141 #define Z_ProtocolVersion_3 2
143 #define Z_Options_search 0
144 #define Z_Options_present 1
145 #define Z_Options_delSet 2
146 #define Z_Options_resourceReport 3
147 #define Z_Options_triggerResourceCtrl 4
148 #define Z_Options_resourceCtrl 5
149 #define Z_Options_accessCtrl 6
150 #define Z_Options_scan 7
151 #define Z_Options_sort 8
152 #define Z_Options_reserved 9
153 #define Z_Options_extendedServices 10
154 #define Z_Options_level_1Segmentation 11
155 #define Z_Options_level_2Segmentation 12
156 #define Z_Options_concurrentOperations 13
157 #define Z_Options_namedResultSets 14
159 typedef struct Z_InitRequest
161 Z_ReferenceId *referenceId; /* OPTIONAL */
162 Odr_bitmask *protocolVersion;
163 Odr_bitmask *options;
164 int *preferredMessageSize;
165 int *maximumRecordSize;
166 Z_IdAuthentication* idAuthentication; /* OPTIONAL */
167 char *implementationId; /* OPTIONAL */
168 char *implementationName; /* OPTIONAL */
169 char *implementationVersion; /* OPTIONAL */
170 Z_External *userInformationField; /* OPTIONAL */
171 Z_OtherInformation *otherInfo; /* OPTIONAL */
174 typedef struct Z_InitResponse
176 Z_ReferenceId *referenceId; /* OPTIONAL */
177 Odr_bitmask *protocolVersion;
178 Odr_bitmask *options;
179 int *preferredMessageSize;
180 int *maximumRecordSize;
182 char *implementationId; /* OPTIONAL */
183 char *implementationName; /* OPTIONAL */
184 char *implementationVersion; /* OPTIONAL */
185 Z_External *userInformationField; /* OPTIONAL */
186 Z_OtherInformation *otherInfo; /* OPTIONAL */
189 typedef struct Z_NSRAuthentication
194 } Z_NSRAuthentication;
196 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt,
199 int z_StrAuthentication(ODR o, char **p, int opt, const char *name);
201 /* ------------------ SEARCH SERVICE ----------------*/
203 typedef struct Z_DatabaseSpecificUnit
206 char *elementSetName;
207 } Z_DatabaseSpecificUnit;
209 typedef struct Z_DatabaseSpecific
212 Z_DatabaseSpecificUnit **elements;
213 } Z_DatabaseSpecific;
215 typedef struct Z_ElementSetNames
218 #define Z_ElementSetNames_generic 0
219 #define Z_ElementSetNames_databaseSpecific 1
223 Z_DatabaseSpecific *databaseSpecific;
227 /* ---------------------- RPN QUERY --------------------------- */
229 typedef struct Z_ComplexAttribute
232 Z_StringOrNumeric **list;
233 int num_semanticAction;
234 int **semanticAction; /* OPTIONAL */
235 } Z_ComplexAttribute;
237 typedef struct Z_AttributeElement
239 Odr_oid *attributeSet; /* OPTIONAL - v3 only */
242 #define Z_AttributeValue_numeric 0
243 #define Z_AttributeValue_complex 1
247 Z_ComplexAttribute *complex;
249 } Z_AttributeElement;
251 typedef struct Z_Term
254 #define Z_Term_general 0
255 #define Z_Term_numeric 1
256 #define Z_Term_characterString 2
258 #define Z_Term_dateTime 4
259 #define Z_Term_external 5
260 #define Z_Term_integerAndUnit 6
261 #define Z_Term_null 7
264 Odr_oct *general; /* this is required for v2 */
266 char *characterString;
269 Z_External *external;
270 /* Z_IntUnit *integerAndUnit; */
275 typedef struct Z_AttributesPlusTerm
278 Z_AttributeElement **attributeList;
280 } Z_AttributesPlusTerm;
282 typedef struct Z_ResultSetPlusAttributes
286 Z_AttributeElement **attributeList;
287 } Z_ResultSetPlusAttributes;
289 typedef struct Z_ProximityOperator
291 bool_t *exclusion; /* OPTIONAL */
295 #define Z_Prox_lessThan 1
296 #define Z_Prox_lessThanOrEqual 2
297 #define Z_Prox_equal 3
298 #define Z_Prox_greaterThanOrEqual 4
299 #define Z_Prox_greaterThan 5
300 #define Z_Prox_notEqual 6
302 #define Z_ProxCode_known 0
303 #define Z_ProxCode_private 1
304 int *proximityUnitCode;
305 #define Z_ProxUnit_character 1
306 #define Z_ProxUnit_word 2
307 #define Z_ProxUnit_sentence 3
308 #define Z_ProxUnit_paragraph 4
309 #define Z_ProxUnit_section 5
310 #define Z_ProxUnit_chapter 6
311 #define Z_ProxUnit_document 7
312 #define Z_ProxUnit_element 8
313 #define Z_ProxUnit_subelement 9
314 #define Z_ProxUnit_elementType 10
315 #define Z_ProxUnit_byte 11 /* v3 only */
316 } Z_ProximityOperator;
318 typedef struct Z_Operator
321 #define Z_Operator_and 0
322 #define Z_Operator_or 1
323 #define Z_Operator_and_not 2
324 #define Z_Operator_prox 3
327 Odr_null *and; /* these guys are nulls. */
330 Z_ProximityOperator *prox;
334 typedef struct Z_Operand
337 #define Z_Operand_APT 0
338 #define Z_Operand_resultSetId 1
339 #define Z_Operand_resultAttr /* v3 only */ 2
342 Z_AttributesPlusTerm *attributesPlusTerm;
343 Z_ResultSetId *resultSetId;
344 Z_ResultSetPlusAttributes *resultAttr;
348 typedef struct Z_Complex
350 struct Z_RPNStructure *s1;
351 struct Z_RPNStructure *s2;
352 Z_Operator *roperator;
355 typedef struct Z_RPNStructure
358 #define Z_RPNStructure_simple 0
359 #define Z_RPNStructure_complex 1
367 typedef struct Z_RPNQuery
369 Odr_oid *attributeSetId;
370 Z_RPNStructure *RPNStructure;
373 /* -------------------------- SEARCHREQUEST -------------------------- */
375 typedef struct Z_Query
378 #define Z_Query_type_1 1
379 #define Z_Query_type_2 2
380 #define Z_Query_type_101 3
385 Z_RPNQuery *type_101;
389 typedef struct Z_SearchRequest
391 Z_ReferenceId *referenceId; /* OPTIONAL */
392 int *smallSetUpperBound;
393 int *largeSetLowerBound;
394 int *mediumSetPresentNumber;
395 bool_t *replaceIndicator;
397 int num_databaseNames;
398 char **databaseNames;
399 Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */
400 Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */
401 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
403 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */
404 Z_OtherInformation *otherInfo; /* OPTIONAL */
407 /* ------------------------ RECORD -------------------------- */
409 typedef Z_External Z_DatabaseRecord;
411 typedef struct Z_DefaultDiagFormat
413 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
415 /* until the whole character set issue becomes more definite,
416 * you can probably ignore this on input. */
418 #define Z_DiagForm_v2AddInfo 0
419 #define Z_DiagForm_v3AddInfo 1
421 } Z_DefaultDiagFormat;
423 typedef struct Z_DiagRec
426 #define Z_DiagRec_defaultFormat 0
427 #define Z_DiagRec_externallyDefined 1
430 Z_DefaultDiagFormat *defaultFormat;
431 Z_External *externallyDefined;
435 typedef struct Z_DiagRecs
438 Z_DiagRec **diagRecs;
441 typedef struct Z_NamePlusRecord
443 char *databaseName; /* OPTIONAL */
445 #define Z_NamePlusRecord_databaseRecord 0
446 #define Z_NamePlusRecord_surrogateDiagnostic 1
449 Z_DatabaseRecord *databaseRecord;
450 Z_DiagRec *surrogateDiagnostic;
454 typedef struct Z_NamePlusRecordList
457 Z_NamePlusRecord **records;
458 } Z_NamePlusRecordList;
460 typedef struct Z_Records
463 #define Z_Records_DBOSD 0
464 #define Z_Records_NSD 1
465 #define Z_Records_multipleNSD 2
468 Z_NamePlusRecordList *databaseOrSurDiagnostics;
469 Z_DiagRec *nonSurrogateDiagnostic;
470 Z_DiagRecs *multipleNonSurDiagnostics;
474 /* ------------------------ SEARCHRESPONSE ------------------ */
476 typedef struct Z_SearchResponse
478 Z_ReferenceId *referenceId; /* OPTIONAL */
480 int *numberOfRecordsReturned;
481 int *nextResultSetPosition;
482 bool_t *searchStatus;
483 int *resultSetStatus; /* OPTIONAL */
484 #define Z_RES_SUBSET 1
485 #define Z_RES_INTERIM 2
487 int *presentStatus; /* OPTIONAL */
488 #define Z_PRES_SUCCESS 0
489 #define Z_PRES_PARTIAL_1 1
490 #define Z_PRES_PARTIAL_2 2
491 #define Z_PRES_PARTIAL_3 3
492 #define Z_PRES_PARTIAL_4 4
493 #define Z_PRES_FAILURE 5
494 Z_Records *records; /* OPTIONAL */
495 Z_OtherInformation *additionalSearchInfo;
496 Z_OtherInformation *otherInfo;
499 /* ------------------------- PRESENT SERVICE -----------------*/
501 typedef struct Z_ElementSpec
504 #define Z_ElementSpec_elementSetName 0
505 #define Z_ElementSpec_externalSpec 1
508 char *elementSetName;
509 Z_External *externalSpec;
513 typedef struct Z_Specification
515 Odr_oid *schema; /* OPTIONAL */
516 Z_ElementSpec *elementSpec; /* OPTIONAL */
519 typedef struct Z_DbSpecific
522 Z_Specification *spec;
525 typedef struct Z_CompSpec
527 bool_t *selectAlternativeSyntax;
528 Z_Specification *generic; /* OPTIONAL */
530 Z_DbSpecific **dbSpecific; /* OPTIONAL */
531 int num_recordSyntax;
532 Odr_oid **recordSyntax; /* OPTIONAL */
535 typedef struct Z_RecordComposition
538 #define Z_RecordComp_simple 0
539 #define Z_RecordComp_complex 1
542 Z_ElementSetNames *simple;
545 } Z_RecordComposition;
547 typedef struct Z_Range
549 int *startingPosition;
550 int *numberOfRecords;
553 typedef struct Z_PresentRequest
555 Z_ReferenceId *referenceId; /* OPTIONAL */
556 Z_ResultSetId *resultSetId;
557 int *resultSetStartPoint;
558 int *numberOfRecordsRequested;
560 Z_Range **additionalRanges; /* OPTIONAL */
561 Z_RecordComposition *recordComposition; /* OPTIONAL */
562 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
563 int *maxSegmentCount; /* OPTIONAL */
564 int *maxRecordSize; /* OPTIONAL */
565 int *maxSegmentSize; /* OPTIONAL */
566 Z_OtherInformation *otherInfo; /* OPTIONAL */
569 typedef struct Z_PresentResponse
571 Z_ReferenceId *referenceId; /* OPTIONAL */
572 int *numberOfRecordsReturned;
573 int *nextResultSetPosition;
576 Z_OtherInformation *otherInfo; /* OPTIONAL */
579 /* ------------------ RESOURCE CONTROL ----------------*/
581 typedef struct Z_TriggerResourceControlRequest
583 Z_ReferenceId *referenceId; /* OPTIONAL */
584 int *requestedAction;
585 #define Z_TriggerResourceCtrl_resourceReport 1
586 #define Z_TriggerResourceCtrl_resourceControl 2
587 #define Z_TriggerResourceCtrl_cancel 3
588 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
589 bool_t *resultSetWanted; /* OPTIONAL */
590 Z_OtherInformation *otherInfo;
591 } Z_TriggerResourceControlRequest;
593 typedef struct Z_ResourceControlRequest
595 Z_ReferenceId *referenceId; /* OPTIONAL */
596 bool_t *suspendedFlag; /* OPTIONAL */
597 Z_External *resourceReport; /* OPTIONAL */
598 int *partialResultsAvailable; /* OPTIONAL */
599 #define Z_ResourceControlRequest_subset 1
600 #define Z_ResourceControlRequest_interim 2
601 #define Z_ResourceControlRequest_none 3
602 bool_t *responseRequired;
603 bool_t *triggeredRequestFlag; /* OPTIONAL */
604 Z_OtherInformation *otherInfo;
605 } Z_ResourceControlRequest;
607 typedef struct Z_ResourceControlResponse
609 Z_ReferenceId *referenceId; /* OPTIONAL */
610 bool_t *continueFlag;
611 bool_t *resultSetWanted; /* OPTIONAL */
612 Z_OtherInformation *otherInfo;
613 } Z_ResourceControlResponse;
616 /* ------------------ ACCESS CTRL SERVICE ----------------*/
618 typedef struct Z_AccessControlRequest
620 Z_ReferenceId *referenceId; /* OPTIONAL */
622 #define Z_AccessRequest_simpleForm 0
623 #define Z_AccessRequest_externallyDefined 1
627 Z_External *externallyDefined;
629 Z_OtherInformation *otherInfo; /* OPTIONAL */
630 } Z_AccessControlRequest;
632 typedef struct Z_AccessControlResponse
634 Z_ReferenceId *referenceId; /* OPTIONAL */
636 #define Z_AccessResponse_simpleForm 0
637 #define Z_AccessResponse_externallyDefined 1
641 Z_External *externallyDefined;
643 Z_DiagRec *diagnostic; /* OPTIONAL */
644 Z_OtherInformation *otherInfo; /* OPTIONAL */
645 } Z_AccessControlResponse;
647 /* ------------------------ SCAN SERVICE -------------------- */
649 typedef struct Z_AttributeList
652 Z_AttributeElement **attributes;
655 typedef struct Z_AlternativeTerm
658 Z_AttributesPlusTerm **terms;
661 typedef struct Z_ByDatabase
664 int *num; /* OPTIONAL */
665 Z_OtherInformation *otherDbInfo; /* OPTIONAL */
668 typedef struct Z_ByDatabaseList
671 Z_ByDatabase **elements;
674 typedef struct Z_ScanOccurrences
677 #define Z_ScanOccurrences_global 0
678 #define Z_ScanOccurrences_byDatabase 1
682 Z_ByDatabaseList *byDatabase;
687 typedef struct Z_OccurrenceByAttributesElem
689 Z_AttributeList *attributes;
690 Z_ScanOccurrences *occurrences; /* OPTIONAL */
691 Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
692 } Z_OccurrenceByAttributesElem;
694 typedef struct Z_OccurrenceByAttributes
697 Z_OccurrenceByAttributesElem **elements;
698 } Z_OccurrenceByAttributes;
700 typedef struct Z_TermInfo
703 char *displayTerm; /* OPTIONAL */
704 Z_AttributeList *suggestedAttributes; /* OPTIONAL */
705 Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
706 int *globalOccurrences; /* OPTIONAL */
707 Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
708 Z_OtherInformation *otherTermInfo; /* OPTIONAL */
711 typedef struct Z_Entry
714 #define Z_Entry_termInfo 0
715 #define Z_Entry_surrogateDiagnostic 1
718 Z_TermInfo *termInfo;
719 Z_DiagRec *surrogateDiagnostic;
723 #ifdef BUGGY_LISTENTRIES
725 typedef struct Z_Entries
731 typedef struct Z_ListEntries
734 #define Z_ListEntries_entries 0
735 #define Z_ListEntries_nonSurrogateDiagnostics 1
739 Z_DiagRecs *nonSurrogateDiagnostics;
745 typedef struct Z_ListEntries {
747 Z_Entry **entries; /* OPT */
748 int num_nonsurrogateDiagnostics;
749 Z_DiagRec **nonsurrogateDiagnostics; /* OPT */
752 typedef struct Z_ScanRequest
754 Z_ReferenceId *referenceId; /* OPTIONAL */
755 int num_databaseNames;
756 char **databaseNames;
757 Odr_oid *attributeSet; /* OPTIONAL */
758 Z_AttributesPlusTerm *termListAndStartPoint;
759 int *stepSize; /* OPTIONAL */
760 int *numberOfTermsRequested;
761 int *preferredPositionInResponse; /* OPTIONAL */
762 Z_OtherInformation *otherInfo;
765 typedef struct Z_ScanResponse
767 Z_ReferenceId *referenceId; /* OPTIONAL */
768 int *stepSize; /* OPTIONAL */
770 #define Z_Scan_success 0
771 #define Z_Scan_partial_1 1
772 #define Z_Scan_partial_2 2
773 #define Z_Scan_partial_3 3
774 #define Z_Scan_partial_4 4
775 #define Z_Scan_partial_5 5
776 #define Z_Scan_failure 6
777 int *numberOfEntriesReturned;
778 int *positionOfTerm; /* OPTIONAL */
779 Z_ListEntries *entries; /* OPTIONAL */
780 Odr_oid *attributeSet; /* OPTIONAL */
781 Z_OtherInformation *otherInfo;
785 /* ------------------------ DELETE -------------------------- */
787 #define Z_DeleteStatus_success 0
788 #define Z_DeleteStatus_resultSetDidNotExist 1
789 #define Z_DeleteStatus_previouslyDeletedByTarget 2
790 #define Z_DeleteStatus_systemProblemAtTarget 3
791 #define Z_DeleteStatus_accessNotAllowed 4
792 #define Z_DeleteStatus_resourceControlAtOrigin 5
793 #define Z_DeleteStatus_resourceControlAtTarget 6
794 #define Z_DeleteStatus_bulkDeleteNotSupported 7
795 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
796 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
797 #define Z_DeleteStatus_resultSetInUse 10
799 typedef struct Z_ListStatus
805 typedef struct Z_DeleteResultSetRequest
807 Z_ReferenceId *referenceId; /* OPTIONAL */
809 #define Z_DeleteRequest_list 0
810 #define Z_DeleteRequest_all 1
811 int num_resultSetList;
812 Z_ResultSetId **resultSetList; /* OPTIONAL */
813 Z_OtherInformation *otherInfo;
814 } Z_DeleteResultSetRequest;
816 typedef struct Z_ListStatuses {
818 Z_ListStatus **elements;
821 typedef struct Z_DeleteResultSetResponse
823 Z_ReferenceId *referenceId; /* OPTIONAL */
824 int *deleteOperationStatus;
825 Z_ListStatuses *deleteListStatuses;/* OPTIONAL */
826 int *numberNotDeleted; /* OPTIONAL */
827 Z_ListStatuses *bulkStatuses; /* OPTIONAL */
828 char *deleteMessage; /* OPTIONAL */
829 Z_OtherInformation *otherInfo;
830 } Z_DeleteResultSetResponse;
832 /* ------------------------ CLOSE SERVICE ------------------- */
834 typedef struct Z_Close
836 Z_ReferenceId *referenceId; /* OPTIONAL */
838 #define Z_Close_finished 0
839 #define Z_Close_shutdown 1
840 #define Z_Close_systemProblem 2
841 #define Z_Close_costLimit 3
842 #define Z_Close_resources 4
843 #define Z_Close_securityViolation 5
844 #define Z_Close_protocolError 6
845 #define Z_Close_lackOfActivity 7
846 #define Z_Close_peerAbort 8
847 #define Z_Close_unspecified 9
848 char *diagnosticInformation; /* OPTIONAL */
849 Odr_oid *resourceReportFormat; /* OPTIONAL */
850 Z_External *resourceReport; /* OPTIONAL */
851 Z_OtherInformation *otherInfo; /* OPTIONAL */
854 /* ------------------------ SEGMENTATION -------------------- */
856 typedef struct Z_Segment
858 Z_ReferenceId *referenceId; /* OPTIONAL */
859 int *numberOfRecordsReturned;
860 int num_segmentRecords;
861 Z_NamePlusRecord **segmentRecords;
862 Z_OtherInformation *otherInfo; /* OPTIONAL */
865 /* ----------------------- Extended Services ---------------- */
867 typedef struct Z_Permissions
870 int num_allowableFunctions;
871 int **allowableFunctions;
872 #define Z_Permissions_delete 1
873 #define Z_Permissions_modifyContents 2
874 #define Z_Permissions_modifyPermissions 3
875 #define Z_Permissions_present 4
876 #define Z_Permissions_invoke 5
879 typedef struct Z_ExtendedServicesRequest
881 Z_ReferenceId *referenceId; /* OPTIONAL */
883 #define Z_ExtendedServicesRequest_create 1
884 #define Z_ExtendedServicesRequest_delete 2
885 #define Z_ExtendedServicesRequest_modify 3
886 Odr_oid *packageType;
887 char *packageName; /* OPTIONAL */
888 char *userId; /* OPTIONAL */
889 Z_IntUnit *retentionTime; /* OPTIONAL */
890 Z_Permissions *permissions; /* OPTIONAL */
891 char *description; /* OPTIONAL */
892 Z_External *taskSpecificParameters; /* OPTIONAL */
894 #define Z_ExtendedServicesRequest_wait 1
895 #define Z_ExtendedServicesRequest_waitIfPossible 2
896 #define Z_ExtendedServicesRequest_dontWait 3
897 #define Z_ExtendedServicesRequest_dontReturnPackage 4
898 char *elements; /* OPTIONAL */
899 Z_OtherInformation *otherInfo; /* OPTIONAL */
900 } Z_ExtendedServicesRequest;
902 typedef struct Z_ExtendedServicesResponse
904 Z_ReferenceId *referenceId; /* OPTIONAL */
905 int *operationStatus;
906 #define Z_ExtendedServicesResponse_done 1
907 #define Z_ExtendedServicesResponse_accepted 2
908 #define Z_ExtendedServicesResponse_failure 3
910 Z_DiagRec **diagnostics; /* OPTIONAL */
911 Z_External *taskPackage; /* OPTIONAL */
912 Z_OtherInformation *otherInfo; /* OPTIONAL */
913 } Z_ExtendedServicesResponse;
915 /* ------------------------ Sort --------------------------- */
917 typedef struct Z_SortAttributes
920 Z_AttributeList *list;
923 typedef struct Z_SortKey
926 #define Z_SortKey_sortField 0
927 #define Z_SortKey_elementSpec 1
928 #define Z_SortKey_sortAttributes 2
932 Z_Specification *elementSpec;
933 Z_SortAttributes *sortAttributes;
937 typedef struct Z_SortDbSpecific
943 typedef struct Z_SortDbSpecificList
946 Z_SortDbSpecific **dbSpecific;
947 } Z_SortDbSpecificList;
949 typedef struct Z_SortElement
952 #define Z_SortElement_generic 0
953 #define Z_SortElement_databaseSpecific 1
957 Z_SortDbSpecificList *databaseSpecific;
961 typedef struct Z_SortMissingValueAction
964 #define Z_SortMissingValAct_abort 0
965 #define Z_SortMissingValAct_null 1
966 #define Z_SortMissingValAct_valData 2
973 } Z_SortMissingValueAction;
975 typedef struct Z_SortKeySpec
977 Z_SortElement *sortElement;
979 #define Z_SortRelation_ascending 0
980 #define Z_SortRelation_descending 1
981 #define Z_SortRelation_ascendingByFreq 3
982 #define Z_SortRelation_descendingByFreq 4
983 int *caseSensitivity;
984 #define Z_SortCase_caseSensitive 0
985 #define Z_SortCase_caseInsensitive 1
986 Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
989 typedef struct Z_SortResponse
991 Z_ReferenceId *referenceId; /* OPTIONAL */
993 #define Z_SortStatus_success 0
994 #define Z_SortStatus_partial_1 1
995 #define Z_SortStatus_failure 2
996 int *resultSetStatus; /* OPTIONAL */
997 #define Z_SortResultSetStatus_empty 1
998 #define Z_SortResultSetStatus_interim 2
999 #define Z_SortResultSetStatus_unchanged 3
1000 #define Z_SortResultSetStatus_none 4
1001 Z_DiagRecs *diagnostics; /* OPTIONAL */
1002 Z_OtherInformation *otherInfo; /* OPTIONAL */
1005 typedef struct Z_SortKeySpecList
1008 Z_SortKeySpec **specs;
1009 } Z_SortKeySpecList;
1011 typedef struct Z_SortRequest
1013 Z_ReferenceId *referenceId; /* OPTIONAL */
1014 Z_StringList *inputResultSetNames;
1015 char *sortedResultSetName;
1016 Z_SortKeySpecList *sortSequence;
1017 Z_OtherInformation *otherInfo; /* OPTIONAL */
1020 /* ----------------------- Resource Report ------------------ */
1022 typedef struct Z_ResourceReportRequest
1024 Z_ReferenceId *referenceId; /* OPTIONAL */
1025 Z_ReferenceId *opId; /* OPTIONAL */
1026 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
1027 Z_OtherInformation *otherInfo; /* OPTIONAL */
1028 } Z_ResourceReportRequest;
1030 typedef struct Z_ResourceReportResponse
1032 Z_ReferenceId *referenceId; /* OPTIONAL */
1033 int *resourceReportStatus;
1034 #define Z_ResourceReportStatus_success 0
1035 #define Z_ResourceReportStatus_partial 1
1036 #define Z_ResourceReportStatus_failure_1 2
1037 #define Z_ResourceReportStatus_failure_2 3
1038 #define Z_ResourceReportStatus_failure_3 4
1039 #define Z_ResourceReportStatus_failure_4 5
1040 #define Z_ResourceReportStatus_failure_5 6
1041 #define Z_ResourceReportStatus_failure_6 7
1042 Z_External *resourceReport; /* OPTIONAL */
1043 Z_OtherInformation *otherInfo; /* OPTIONAL */
1044 } Z_ResourceReportResponse;
1046 /* ------------------------ APDU ---------------------------- */
1048 typedef struct Z_APDU
1051 #define Z_APDU_initRequest 0
1052 #define Z_APDU_initResponse 1
1053 #define Z_APDU_searchRequest 2
1054 #define Z_APDU_searchResponse 3
1055 #define Z_APDU_presentRequest 4
1056 #define Z_APDU_presentResponse 5
1057 #define Z_APDU_deleteResultSetRequest 6
1058 #define Z_APDU_deleteResultSetResponse 7
1059 #define Z_APDU_resourceControlRequest 8
1060 #define Z_APDU_resourceControlResponse 9
1061 #define Z_APDU_triggerResourceControlRequest 10
1062 #define Z_APDU_scanRequest 11
1063 #define Z_APDU_scanResponse 12
1064 #define Z_APDU_segmentRequest 13
1065 #define Z_APDU_extendedServicesRequest 14
1066 #define Z_APDU_extendedServicesResponse 15
1067 #define Z_APDU_close 16
1068 #define Z_APDU_accessControlRequest 17
1069 #define Z_APDU_accessControlResponse 18
1070 #define Z_APDU_sortRequest 20
1071 #define Z_APDU_sortResponse 21
1072 #define Z_APDU_resourceReportRequest 22
1073 #define Z_APDU_resourceReportResponse 23
1076 Z_InitRequest *initRequest;
1077 Z_InitResponse *initResponse;
1078 Z_SearchRequest *searchRequest;
1079 Z_SearchResponse *searchResponse;
1080 Z_PresentRequest *presentRequest;
1081 Z_PresentResponse *presentResponse;
1082 Z_DeleteResultSetRequest *deleteResultSetRequest;
1083 Z_DeleteResultSetResponse *deleteResultSetResponse;
1084 Z_AccessControlRequest *accessControlRequest;
1085 Z_AccessControlResponse *accessControlResponse;
1086 Z_ResourceControlRequest *resourceControlRequest;
1087 Z_ResourceControlResponse *resourceControlResponse;
1088 Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1089 Z_ResourceReportRequest *resourceReportRequest;
1090 Z_ResourceReportResponse *resourceReportResponse;
1091 Z_ScanRequest *scanRequest;
1092 Z_ScanResponse *scanResponse;
1093 Z_SortRequest *sortRequest;
1094 Z_SortResponse *sortResponse;
1095 Z_Segment *segmentRequest;
1096 Z_ExtendedServicesRequest *extendedServicesRequest;
1097 Z_ExtendedServicesResponse *extendedServicesResponse;
1102 #define z_APDU z_APDU_old
1104 YAZ_EXPORT int z_APDU(ODR o, Z_APDU **p, int opt, const char *name);
1105 YAZ_EXPORT int z_SUTRS(ODR o, Odr_oct **p, int opt, const char *name);
1107 YAZ_EXPORT Z_InitRequest *zget_InitRequest(ODR o);
1108 YAZ_EXPORT Z_InitResponse *zget_InitResponse(ODR o);
1109 YAZ_EXPORT Z_SearchRequest *zget_SearchRequest(ODR o);
1110 YAZ_EXPORT Z_SearchResponse *zget_SearchResponse(ODR o);
1111 YAZ_EXPORT Z_PresentRequest *zget_PresentRequest(ODR o);
1112 YAZ_EXPORT Z_PresentResponse *zget_PresentResponse(ODR o);
1113 YAZ_EXPORT Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1114 YAZ_EXPORT Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1115 YAZ_EXPORT Z_ScanRequest *zget_ScanRequest(ODR o);
1116 YAZ_EXPORT Z_ScanResponse *zget_ScanResponse(ODR o);
1117 YAZ_EXPORT Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1118 YAZ_EXPORT Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1119 YAZ_EXPORT Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1120 YAZ_EXPORT Z_Close *zget_Close(ODR o);
1121 YAZ_EXPORT int z_StringList(ODR o, Z_StringList **p, int opt,
1123 YAZ_EXPORT int z_InternationalString(ODR o, char **p, int opt,
1125 YAZ_EXPORT int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt,
1127 YAZ_EXPORT int z_ElementSetName(ODR o, char **p, int opt, const char *name);
1128 YAZ_EXPORT int z_IntUnit(ODR o, Z_IntUnit **p, int opt, const char *name);
1129 YAZ_EXPORT int z_Unit(ODR o, Z_Unit **p, int opt, const char *name);
1130 YAZ_EXPORT int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt,
1132 YAZ_EXPORT int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt,
1134 YAZ_EXPORT int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p,
1135 int opt, const char *name);
1136 YAZ_EXPORT int z_Term(ODR o, Z_Term **p, int opt, const char *name);
1137 YAZ_EXPORT int z_Specification(ODR o, Z_Specification **p, int opt,
1139 YAZ_EXPORT int z_Permissions(ODR o, Z_Permissions **p, int opt,
1141 YAZ_EXPORT int z_DiagRec(ODR o, Z_DiagRec **p, int opt, const char *name);
1142 YAZ_EXPORT int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt, const char *name);
1143 YAZ_EXPORT int z_AttributeList(ODR o, Z_AttributeList **p, int opt,
1145 YAZ_EXPORT int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt,
1147 YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which);
1148 YAZ_EXPORT int z_Query(ODR o, Z_Query **p, int opt, const char *name);
1154 #include <yaz/prt-rsc.h>
1155 #include <yaz/prt-acc.h>
1156 #include <yaz/prt-exp.h>
1157 #include <yaz/prt-grs.h>
1158 #include <yaz/prt-arc.h>
1159 #include <yaz/prt-exd.h>
1160 #include <yaz/prt-dia.h>
1161 #include <yaz/prt-esp.h>
1162 #include <yaz/prt-add.h>
1164 #include <yaz/prt-dat.h>
1165 #include <yaz/prt-univ.h>
1166 #include <yaz/prt-ext.h>