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