Client uses prefix query notation.
[yaz-moved-to-github.git] / include / proto.h
1 /*
2  * Copyright (c) 1995, Index Data.
3  *
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,
6  * provided that:
7  *
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.
11  *
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.
15  *
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
24  * OF THIS SOFTWARE.
25  *
26  * $Log: proto.h,v $
27  * Revision 1.9  1995-05-22 11:31:25  quinn
28  * Added PDUs
29  *
30  * Revision 1.8  1995/05/17  08:41:35  quinn
31  * Added delete to proto & other little things.
32  * Relaying auth info to backend.
33  *
34  * Revision 1.7  1995/05/16  08:50:37  quinn
35  * License, documentation, and memory fixes
36  *
37  * Revision 1.6  1995/05/15  11:55:55  quinn
38  * Work on asynchronous activity.
39  *
40  * Revision 1.5  1995/04/17  11:28:18  quinn
41  * Smallish
42  *
43  * Revision 1.4  1995/04/10  10:22:47  quinn
44  * Added SCAN
45  *
46  * Revision 1.3  1995/03/30  12:18:09  quinn
47  * Added info.
48  *
49  * Revision 1.2  1995/03/30  10:26:48  quinn
50  * Added Term structure
51  *
52  * Revision 1.1  1995/03/30  09:39:42  quinn
53  * Moved .h files to include directory
54  *
55  * Revision 1.11  1995/03/30  09:08:44  quinn
56  * Added Resource control protocol
57  *
58  * Revision 1.10  1995/03/29  15:39:39  quinn
59  * Adding some resource control elements, and a null-check to getentbyoid
60  *
61  * Revision 1.9  1995/03/29  08:06:18  quinn
62  * Added a few v3 elements
63  *
64  * Revision 1.8  1995/03/22  10:12:49  quinn
65  * Added Z_PRES constants.
66  *
67  * Revision 1.7  1995/03/20  09:45:12  quinn
68  * Working towards v3
69  *
70  * Revision 1.5  1995/03/07  16:29:34  quinn
71  * Added authentication stuff.
72  *
73  * Revision 1.4  1995/03/07  10:13:00  quinn
74  * Added prototype for z_APDU()
75  *
76  * Revision 1.3  1995/02/14  11:54:23  quinn
77  * Fixing include.
78  *
79  * Revision 1.2  1995/02/09  15:51:40  quinn
80  * Works better now.
81  *
82  * Revision 1.1  1995/02/06  16:44:48  quinn
83  * First hack at Z/SR protocol
84  *
85  */
86
87 #ifndef PROTO_H
88 #define PROTO_H
89
90 #include <odr.h>
91 #include <odr_use.h>
92
93 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
94
95 typedef Odr_oct Z_ReferenceId;
96 typedef char Z_DatabaseName;
97 typedef char Z_ResultSetId;
98 typedef Odr_oct Z_ResultsetId;
99 typedef Odr_external Z_UserInformationField;
100
101 typedef struct Z_InfoCategory
102 {
103     Odr_oid *categoryTypeId;         /* OPTIONAL */
104     int *categoryValue;
105 } Z_InfoCategory;
106
107 typedef struct Z_OtherInformationUnit
108 {
109     Z_InfoCategory *category;        /* OPTIONAL */
110     enum
111     {
112         Z_OtherInfo_characterInfo,
113         Z_OtherInfo_binaryInfo,
114         Z_OtherInfo_externallyDefinedInfo,
115         Z_OtherInfo_oid
116     } which;
117     union
118     {
119         char *characterInfo; 
120         Odr_oct *binaryInfo;
121         Odr_external *externallyDefinedInfo;
122         Odr_oid *oid;
123     } u;
124 } Z_OtherInformationUnit;
125
126 typedef struct Z_OtherInformation
127 {
128     int num_elements;
129     Z_OtherInformationUnit **list;
130 } Z_OtherInformation;
131
132 /* ----------------- INIT SERVICE  ----------------*/
133
134 typedef struct
135 {
136     char *groupId;       /* OPTIONAL */
137     char *userId;         /* OPTIONAL */
138     char *password;      /* OPTIONAL */
139 } Z_IdPass;
140
141 typedef struct Z_IdAuthentication
142 {
143     enum
144     {
145         Z_IdAuthentication_open,
146         Z_IdAuthentication_idPass,
147         Z_IdAuthentication_anonymous,
148         Z_IdAuthentication_other
149     } which;
150     union
151     {
152         char *open;
153         Z_IdPass *idPass;
154         Odr_null *anonymous;
155         Odr_external *other;
156     } u;
157 } Z_IdAuthentication;
158
159 #define Z_ProtocolVersion_1            0
160 #define Z_ProtocolVersion_2            1
161 #define Z_ProtocolVersion_3            2
162
163 #define Z_Options_search               0
164 #define Z_Options_present              1
165 #define Z_Options_delSet               2
166 #define Z_Options_resourceReport       3
167 #define Z_Options_triggerResourceCtrl  4
168 #define Z_Options_resourceCtrl         5
169 #define Z_Options_accessCtrl           6
170 #define Z_Options_scan                 7
171 #define Z_Options_sort                 8
172 #define Z_Options_reserved             9
173 #define Z_Options_extendedServices    10
174 #define Z_Options_level_1Segmentation 11
175 #define Z_Options_level_2Segmentation 12
176 #define Z_Options_concurrentOperations 13
177 #define Z_Options_namedResultSets     14
178
179 typedef struct Z_InitRequest
180 {
181     Z_ReferenceId *referenceId;                   /* OPTIONAL */
182     Odr_bitmask *options;
183     Odr_bitmask *protocolVersion;
184     int *preferredMessageSize;
185     int *maximumRecordSize;
186     Z_IdAuthentication* idAuthentication;        /* OPTIONAL */
187     char *implementationId;                      /* OPTIONAL */
188     char *implementationName;                    /* OPTIONAL */
189     char *implementationVersion;                 /* OPTIONAL */
190     Z_UserInformationField *userInformationField; /* OPTIONAL */
191 } Z_InitRequest;
192
193 typedef struct Z_InitResponse
194 {
195     Z_ReferenceId *referenceId;    /* OPTIONAL */
196     Odr_bitmask *options;
197     Odr_bitmask *protocolVersion;
198     int *preferredMessageSize;
199     int *maximumRecordSize;
200     bool_t *result;
201     char *implementationId;      /* OPTIONAL */
202     char *implementationName;    /* OPTIONAL */
203     char *implementationVersion; /* OPTIONAL */
204     Z_UserInformationField *userInformationField; /* OPTIONAL */
205 } Z_InitResponse;
206
207 typedef struct Z_NSRAuthentication
208 {
209     char *user;
210     char *password;
211     char *account;
212 } Z_NSRAuthentication;
213
214 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
215
216 int z_StrAuthentication(ODR o, char **p, int opt);
217
218
219 /* ------------------ RESOURCE CONTROL ----------------*/
220
221 typedef struct Z_TriggerResourceControlRequest
222 {
223     Z_ReferenceId *referenceId;    /* OPTIONAL */
224     int *requestedAction;
225 #define Z_TriggerResourceCtrl_resourceReport  1
226 #define Z_TriggerResourceCtrl_resourceControl 2
227 #define Z_TriggerResourceCtrl_cancel          3
228     Odr_oid *prefResourceReportFormat;  /* OPTIONAL */
229     bool_t *resultSetWanted;            /* OPTIONAL */
230 } Z_TriggerResourceControlRequest;
231
232 typedef struct Z_ResourceControlRequest
233 {
234     Z_ReferenceId *referenceId;    /* OPTIONAL */
235     bool_t *suspendedFlag;         /* OPTIONAL */
236     Odr_external *resourceReport; /* OPTIONAL */
237     int *partialResultsAvailable;  /* OPTIONAL */
238 #define Z_ResourceControlRequest_subset    1
239 #define Z_ResourceControlRequest_interim   2
240 #define Z_ResourceControlRequest_none      3
241     bool_t *responseRequired;
242     bool_t *triggeredRequestFlag;  /* OPTIONAL */
243 } Z_ResourceControlRequest;
244
245 typedef struct Z_ResourceControlResponse
246 {
247     Z_ReferenceId *referenceId;    /* OPTIONAL */
248     bool_t *continueFlag;
249     bool_t *resultSetWanted;       /* OPTIONAL */
250 } Z_ResourceControlResponse;
251
252 /* ------------------ SEARCH SERVICE ----------------*/
253
254 typedef Odr_oid Z_PreferredRecordSyntax;
255
256 typedef struct Z_DatabaseSpecificUnit
257 {
258     char *databaseName;
259     char *elementSetName;
260 } Z_DatabaseSpecificUnit;
261
262 typedef struct Z_DatabaseSpecific
263 {
264     int num_elements;
265     Z_DatabaseSpecificUnit **elements;
266 } Z_DatabaseSpecific;
267
268 typedef struct Z_ElementSetNames
269 {
270     int which;
271 #define Z_ElementSetNames_generic 0
272 #define Z_ElementSetNames_databaseSpecific 1
273     union
274     {
275         char *generic;
276         Z_DatabaseSpecific *databaseSpecific;
277     } u;
278 } Z_ElementSetNames;
279
280 /* ---------------------- RPN QUERY --------------------------- */
281
282 typedef struct Z_AttributeElement
283 {
284     int *attributeType;
285     int *attributeValue;
286 } Z_AttributeElement;
287
288 #define Z_V3
289 #ifdef Z_V3
290
291 typedef struct Z_Term 
292 {
293     enum
294     {
295         Z_Term_general,
296         Z_Term_numeric,
297         Z_Term_characterString,
298         Z_Term_oid,
299         Z_Term_dateTime,
300         Z_Term_external,
301         Z_Term_integerAndUnit,
302         Z_Term_null
303     } which;
304     union
305     {
306         Odr_oct *general; /* this is required for v2 */
307         int *numeric;
308         char *characterString;
309         Odr_oid *oid;
310         char *dateTime;
311         Odr_external *external;
312         /* Z_IntUnit *integerAndUnit; */
313         Odr_null *null;
314     } u;
315 } Z_Term;
316
317 #endif
318
319 typedef struct Z_AttributesPlusTerm
320 {
321     int num_attributes;
322     Z_AttributeElement **attributeList;
323 #ifdef Z_V3
324     Z_Term *term;
325 #else
326     Odr_oct *term;
327 #endif
328 } Z_AttributesPlusTerm;
329
330 typedef struct Z_ProximityOperator
331 {
332     bool_t *exclusion;          /* OPTIONAL */
333     int *distance;
334     bool_t *ordered;
335     int *relationType;
336 #define Z_Prox_lessThan           1
337 #define Z_Prox_lessThanOrEqual    2
338 #define Z_Prox_equal              3
339 #define Z_Prox_greaterThanOrEqual 4
340 #define Z_Prox_greaterThan        5
341 #define Z_Prox_notEqual           6
342     enum
343     {
344         Z_ProxCode_known,
345         Z_ProxCode_private
346     } which;
347     int *proximityUnitCode;
348 #define Z_ProxUnit_character       1
349 #define Z_ProxUnit_word            2
350 #define Z_ProxUnit_sentence        3
351 #define Z_ProxUnit_paragraph       4
352 #define Z_ProxUnit_section         5
353 #define Z_ProxUnit_chapter         6
354 #define Z_ProxUnit_document        7
355 #define Z_ProxUnit_element         8
356 #define Z_ProxUnit_subelement      9
357 #define Z_ProxUnit_elementType    10
358 #define Z_ProxUnit_byte           11   /* v3 only */
359 } Z_ProximityOperator;
360
361 typedef struct Z_Operator
362 {
363     enum
364     {
365         Z_Operator_and,
366         Z_Operator_or,
367         Z_Operator_and_not,
368         Z_Operator_prox
369     } which;
370     union
371     {
372         Odr_null *and;          /* these guys are nulls. */
373         Odr_null *or;
374         Odr_null *and_not;
375         Z_ProximityOperator *prox;
376     } u;
377 } Z_Operator;
378
379 typedef struct Z_Operand
380 {
381     int which;
382 #define Z_Operand_APT 0
383 #define Z_Operand_resultSetId 1
384     union
385     {
386         Z_AttributesPlusTerm *attributesPlusTerm;
387         Z_ResultSetId *resultSetId;
388     } u;
389 } Z_Operand;
390
391 typedef struct Z_Complex
392 {
393     struct Z_RPNStructure *s1;
394     struct Z_RPNStructure *s2;
395     Z_Operator *operator;
396 } Z_Complex;
397
398 typedef struct Z_RPNStructure
399 {
400     int which;
401 #define Z_RPNStructure_simple 0
402 #define Z_RPNStructure_complex 1
403     union
404     {
405         Z_Operand *simple;
406         Z_Complex *complex;
407     } u;
408 } Z_RPNStructure;
409
410 typedef struct Z_RPNQuery
411 {
412     Odr_oid *attributeSetId;
413     Z_RPNStructure *RPNStructure;
414 } Z_RPNQuery;
415
416 /* -------------------------- SEARCHREQUEST -------------------------- */
417
418 typedef struct Z_Query
419 {
420     int which;
421 #define Z_Query_type_1 1
422 #define Z_Query_type_2 2
423     union
424     {
425         Z_RPNQuery *type_1;
426         Odr_oct *type_2;
427     } u;
428 } Z_Query;
429
430 typedef struct Z_SearchRequest
431 {
432     Z_ReferenceId *referenceId;   /* OPTIONAL */
433     int *smallSetUpperBound;
434     int *largeSetLowerBound;
435     int *mediumSetPresentNumber;
436     bool_t *replaceIndicator;
437     char *resultSetName;
438     int num_databaseNames;
439     char **databaseNames;
440     Z_ElementSetNames *smallSetElementSetNames;    /* OPTIONAL */
441     Z_ElementSetNames *mediumSetElementSetNames;    /* OPTIONAL */
442     Z_PreferredRecordSyntax *preferredRecordSyntax;  /* OPTIONAL */
443     Z_Query *query;
444 } Z_SearchRequest;
445
446 /* ------------------------ RECORD -------------------------- */
447
448 typedef Odr_external Z_DatabaseRecord;
449
450 typedef struct Z_DiagRec
451 {
452     Odr_oid *diagnosticSetId;
453     int *condition;
454     char *addinfo;
455 } Z_DiagRec;
456
457 typedef struct Z_NamePlusRecord
458 {
459     char *databaseName;      /* OPTIONAL */
460     int which;
461 #define Z_NamePlusRecord_databaseRecord 0
462 #define Z_NamePlusRecord_surrogateDiagnostic 1
463     union
464     {
465         Z_DatabaseRecord *databaseRecord;
466         Z_DiagRec *surrogateDiagnostic;
467     } u;
468 } Z_NamePlusRecord;
469
470 typedef struct Z_NamePlusRecordList
471 {
472     int num_records;
473     Z_NamePlusRecord **records;
474 } Z_NamePlusRecordList;
475
476 typedef struct Z_Records
477 {
478     int which;
479 #define Z_Records_DBOSD 0
480 #define Z_Records_NSD 1
481     union
482     {
483         Z_NamePlusRecordList *databaseOrSurDiagnostics;
484         Z_DiagRec *nonSurrogateDiagnostic;
485     } u;
486 } Z_Records;
487
488 /* ------------------ ACCESS CTRL SERVICE ----------------*/
489
490 typedef struct Z_AccessControlRequest
491 {
492     Z_ReferenceId *referenceId;           /* OPTIONAL */
493     enum
494     {
495         Z_AccessRequest_simpleForm,
496         Z_AccessRequest_externallyDefined
497     } which;
498     union
499     {
500         Odr_oct *simpleForm;
501         Odr_external *externallyDefined;
502     } u;
503 #ifdef Z_OTHERINFO
504     Z_OtherInformation *otherInfo;           /* OPTIONAL */
505 #endif
506 } Z_AccessControlRequest;
507
508 typedef struct Z_AccessControlResponse
509 {
510     Z_ReferenceId *referenceId;              /* OPTIONAL */
511     enum
512     {
513         Z_AccessResponse_simpleForm,
514         Z_AccessResponse_externallyDefined
515     } which;
516     union
517     {
518         Odr_oct *simpleForm;
519         Odr_external *externallyDefined;
520     } u;
521     Z_DiagRec *diagnostic;                   /* OPTIONAL */
522 #ifdef Z_OTHERINFO
523     Z_OtherInformation *otherInfo;           /* OPTIONAL */
524 #endif
525 } Z_AccessControlResponse;
526
527 /* ------------------------ SCAN SERVICE -------------------- */
528
529 typedef struct Z_AttributeList
530 {
531     int num_attributes;
532     Z_AttributeElement **attributes;
533 } Z_AttributeList;
534
535 typedef struct Z_AlternativeTerm
536 {
537     int num_terms;
538     Z_AttributesPlusTerm **terms;
539 } Z_AlternativeTerm;
540
541 typedef struct Z_OccurrenceByAttributes
542 {
543     Z_AttributeList *attributes;
544 #if 0
545     enum
546     {
547         Z_OByAtt_global,
548         Z_ObyAtt_byDatabase
549     } which;
550     union
551     {
552 #endif
553         int *global;
554 #if 0
555         /* Z_ByDatabase *byDatabase; */
556     } u;
557 #endif
558 } Z_OccurrenceByAttributes;
559
560 typedef struct Z_TermInfo
561 {
562     Z_Term *term;
563     Z_AttributeList *suggestedAttributes;  /* OPTIONAL */
564     Z_AlternativeTerm *alternativeTerm;    /* OPTIONAL */
565     int *globalOccurrences;                /* OPTIONAL */
566     Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
567 } Z_TermInfo;
568
569 typedef struct Z_Entry
570 {
571     enum
572     {
573         Z_Entry_termInfo,
574         Z_Entry_surrogateDiagnostic
575     } which;
576     union
577     {
578         Z_TermInfo *termInfo;
579         Z_DiagRec *surrogateDiagnostic;
580     } u;
581 } Z_Entry;
582
583 typedef struct Z_Entries
584 {
585     int num_entries;
586     Z_Entry **entries;
587 } Z_Entries;
588
589 typedef struct Z_DiagRecs
590 {
591     int num_diagRecs;
592     Z_DiagRec **diagRecs;
593 } Z_DiagRecs;
594
595 typedef struct Z_ListEntries
596 {
597     enum
598     {
599         Z_ListEntries_entries,
600         Z_ListEntries_nonSurrogateDiagnostics
601     } which;
602     union
603     {
604         Z_Entries *entries;
605         Z_DiagRecs *nonSurrogateDiagnostics;
606     } u;
607 } Z_ListEntries;
608
609 typedef struct Z_ScanRequest
610 {
611     Z_ReferenceId *referenceId;       /* OPTIONAL */
612     int num_databaseNames;
613     char **databaseNames;
614     Odr_oid *attributeSet;          /* OPTIONAL */
615     Odr_any *eatme1;
616     Z_AttributesPlusTerm *termListAndStartPoint;
617     int *stepSize;                    /* OPTIONAL */
618     int *numberOfTermsRequested;
619     int *preferredPositionInResponse;   /* OPTIONAL */
620 } Z_ScanRequest;
621
622 typedef struct Z_ScanResponse
623 {
624     Z_ReferenceId *referenceId;       /* OPTIONAL */
625     int *stepSize;                    /* OPTIONAL */
626     int *scanStatus;
627 #define Z_Scan_success      0
628 #define Z_Scan_partial_1    1
629 #define Z_Scan_partial_2    2
630 #define Z_Scan_partial_3    3
631 #define Z_Scan_partial_4    4
632 #define Z_Scan_partial_5    5
633 #define Z_Scan_failure      6
634     int *numberOfEntriesReturned;
635     int *positionOfTerm;              /* OPTIONAL */
636     Z_ListEntries *entries;           /* OPTIONAL */
637     Odr_oid *attributeSet;            /* OPTIONAL */
638 } Z_ScanResponse; 
639
640 /* ------------------------ SEARCHRESPONSE ------------------ */
641
642 typedef struct Z_SearchResponse
643 {
644     Z_ReferenceId *referenceId;       /* OPTIONAL */
645     int *resultCount;
646     int *numberOfRecordsReturned;
647     int *nextResultSetPosition;
648     bool_t *searchStatus;
649     int *resultSetStatus;              /* OPTIONAL */
650 #define Z_RES_SUBSET        1
651 #define Z_RES_INTERIM       2
652 #define Z_RES_NONE          3
653     int *presentStatus;                /* OPTIONAL */
654 #define Z_PRES_SUCCESS      0
655 #define Z_PRES_PARTIAL_1    1
656 #define Z_PRES_PARTIAL_2    2
657 #define Z_PRES_PARTIAL_3    3
658 #define Z_PRES_PARTIAL_4    4
659 #define Z_PRES_FAILURE      5
660     Z_Records *records;                  /* OPTIONAL */
661 } Z_SearchResponse;
662
663 /* ------------------------- PRESENT SERVICE -----------------*/
664
665 typedef struct Z_PresentRequest
666 {
667     Z_ReferenceId *referenceId;          /* OPTIONAL */
668     Z_ResultSetId *resultSetId;
669     int *resultSetStartPoint;
670     int *numberOfRecordsRequested;
671     Z_ElementSetNames *elementSetNames;  /* OPTIONAL */
672     Z_PreferredRecordSyntax *preferredRecordSyntax;  /* OPTIONAL */
673 } Z_PresentRequest;
674
675 typedef struct Z_PresentResponse
676 {
677     Z_ReferenceId *referenceId;        /* OPTIONAL */
678     int *numberOfRecordsReturned;
679     int *nextResultSetPosition;
680     int *presentStatus;
681     Z_Records *records;
682 } Z_PresentResponse;
683
684 /* ------------------------ DELETE -------------------------- */
685
686 #define Z_DeleteStatus_success                          0
687 #define Z_DeleteStatus_resultSetDidNotExist             1
688 #define Z_DeleteStatus_previouslyDeletedByTarget        2
689 #define Z_DeleteStatus_systemProblemAtTarget            3
690 #define Z_DeleteStatus_accessNotAllowed                 4
691 #define Z_DeleteStatus_resourceControlAtOrigin          5
692 #define Z_DeleteStatus_resourceControlAtTarget          6
693 #define Z_DeleteStatus_bulkDeleteNotSupported           7
694 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte  8
695 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
696 #define Z_DeleteStatus_resultSetInUse                  10
697
698 typedef struct Z_ListStatus
699 {
700     Z_ResultSetId *id;
701     int *status;
702 } Z_ListStatus;
703
704 typedef struct Z_DeleteResultSetRequest
705 {
706     Z_ReferenceId *referenceId;        /* OPTIONAL */
707     int *deleteFunction;
708 #define Z_DeleteRequest_list    0
709 #define Z_DeleteRequest_all     1
710     int num_ids;
711     Z_ResultSetId **resultSetList;      /* OPTIONAL */
712 #ifdef Z_OTHERINFO
713     Z_OtherInformation *otherInfo;
714 #endif
715 } Z_DeleteResultSetRequest;
716
717 typedef struct Z_DeleteResultSetResponse
718 {
719     Z_ReferenceId *referenceId;        /* OPTIONAL */
720     int *deleteOperationStatus;
721     int num_statuses;
722     Z_ListStatus *deleteListStatuses;  /* OPTIONAL */
723     int *numberNotDeleted;             /* OPTIONAL */
724     int num_bulkStatuses;
725     Z_ListStatus *bulkStatuses;        /* OPTIONAL */
726     char *deleteMessage;               /* OPTIONAL */
727 #ifdef Z_OTHERINFO
728     Z_OtherInformation *otherInfo;
729 #endif
730 } Z_DeleteResultSetResponse;
731
732 /* ------------------------ APDU ---------------------------- */
733
734 typedef struct Z_APDU
735 {    
736     enum Z_APDU_which
737     {
738         Z_APDU_initRequest,
739         Z_APDU_initResponse,
740         Z_APDU_searchRequest,
741         Z_APDU_searchResponse,
742         Z_APDU_presentRequest,
743         Z_APDU_presentResponse,
744         Z_APDU_deleteResultSetRequest,
745         Z_APDU_deleteResultSetResponse,
746         Z_APDU_resourceControlRequest,
747         Z_APDU_resourceControlResponse,
748         Z_APDU_triggerResourceControlRequest,
749         Z_APDU_scanRequest,
750         Z_APDU_scanResponse
751     } which;
752     union
753     {
754         Z_InitRequest  *initRequest;
755         Z_InitResponse *initResponse;
756         Z_SearchRequest *searchRequest;
757         Z_SearchResponse *searchResponse;
758         Z_PresentRequest *presentRequest;
759         Z_PresentResponse *presentResponse;
760         Z_DeleteResultSetRequest *deleteResultSetRequest;
761         Z_DeleteResultSetResponse *deleteResultSetResponse;
762         Z_ResourceControlRequest *resourceControlRequest;
763         Z_ResourceControlResponse *resourceControlResponse;
764         Z_TriggerResourceControlRequest *triggerResourceControlRequest;
765         Z_ScanRequest *scanRequest;
766         Z_ScanResponse *scanResponse;
767     } u;
768 } Z_APDU;
769
770 int z_APDU(ODR o, Z_APDU **p, int opt);
771
772 Z_InitRequest *zget_InitRequest(ODR o);
773 Z_InitResponse *zget_InitResponse(ODR o);
774 Z_SearchRequest *zget_SearchRequest(ODR o);
775 Z_SearchResponse *zget_SearchResponse(ODR o);
776 Z_PresentRequest *zget_PresentRequest(ODR o);
777 Z_PresentResponse *zget_PresentResponse(ODR o);
778 Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
779 Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
780 Z_ScanRequest *zget_ScanRequest(ODR o);
781 Z_ScanResponse *zget_ScanResponse(ODR o);
782 Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
783 Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
784 Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
785 Z_APDU *zget_APDU(ODR o, enum Z_APDU_which which);
786
787 #endif