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