Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
[yaz-moved-to-github.git] / include / prt-exd.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 names 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  */
27
28 #ifndef PRT_EXD_H
29 #define PRT_EXD_H
30
31 #include <yconfig.h>
32
33 typedef struct Z_TaskPackage
34 {
35     Odr_oid *packageType;                 
36     char *packageName;                      /* OPTIONAL */
37     char *userId;                           /* OPTIONAL */
38     Z_IntUnit *retentionTime;               /* OPTIONAL */
39     Z_Permissions *permissions;             /* OPTIONAL */
40     char *description;                      /* OPTIONAL */
41     Odr_oct *targetReference;             
42     char *creationDateTime;    /* OPTIONAL */
43     int *taskStatus;                      
44 #define Z_TaskPackage_pending             0
45 #define Z_TaskPackage_active              1
46 #define Z_TaskPackage_complete            2
47 #define Z_TaskPackage_aborted             3
48     int num_packageDiagnostics;
49     Z_DiagRec **packageDiagnostics;         /* OPTIONAL */
50     Z_External *taskSpecificParameters;   
51 } Z_TaskPackage;
52
53 int z_TaskPackage(ODR o, Z_TaskPackage **p, int opt);
54
55 /* ----------------------- ITEM ORDER ------------------------- */
56
57 typedef struct Z_IOTargetPart
58 {
59     Z_External *itemRequest;                   /* OPTIONAL */
60     Z_External *statusOrErrorReport;
61     int *auxiliaryStatus;                      /* OPTIONAL */
62 #define Z_IOTargetPart_notReceived        1
63 #define Z_IOTargetPart_loanQueue          2
64 #define Z_IOTargetPart_forwarded          3
65 #define Z_IOTargetPart_unfilledCopyright  4
66 #define Z_IOTargetPart_filledCopyright    1
67 } Z_IOTargetPart;
68
69 typedef struct Z_IOResultSetItem
70 {
71     char *resultSetId;
72     int *item;
73 } Z_IOResultSetItem;
74
75 typedef struct Z_IOOriginPartNotToKeep
76 {
77     Z_IOResultSetItem *resultSetItem;          /* OPTIONAL */
78     Z_External *itemRequest;                   /* OPTIONAL */
79 } Z_IOOriginPartNotToKeep;
80
81 typedef struct Z_IOContact
82 {
83     char *name;                                /* OPTIONAL */
84     char *phone;                               /* OPTIONAL */
85     char *email;                               /* OPTIONAL */
86 } Z_IOContact;
87
88 typedef struct Z_IOCreditCardInfo
89 {
90     char *nameOnCard;
91     char *expirationDate;
92     char *cardNumber;
93 } Z_IOCreditCardInfo;
94
95 typedef struct Z_IOBilling
96 {
97     int which;
98 #define Z_IOBilling_billInvoice 0
99 #define Z_IOBilling_prepay 1
100 #define Z_IOBilling_depositAccount 2
101 #define Z_IOBilling_creditCard 3
102 #define Z_IOBilling_cardInfoPreviouslySupplied 4
103 #define Z_IOBilling_privateKnown 5
104 #define Z_IOBilling_privateNotKnown 6
105     union
106     {
107         Odr_null *noinfo;
108         Z_IOCreditCardInfo *creditCard;
109         Z_External *privateNotKnown;
110     } paymentMethod;
111     char *customerReference;                        /* OPTIONAL */
112     char *customerPONumber;                         /* OPTIONAL */
113 } Z_IOBilling;
114
115 typedef struct Z_IOOriginPartToKeep
116 {
117     Z_External *supplDescription;              /* OPTIONAL */
118     Z_IOContact *contact;                      /* OPTIONAL */
119     Z_IOBilling *addlBilling;                  /* OPTIONAL */
120 } Z_IOOriginPartToKeep;
121
122 typedef struct Z_IORequest
123 {
124     Z_IOOriginPartToKeep *toKeep;              /* OPTIONAL */
125     Z_IOOriginPartNotToKeep *notToKeep;
126 } Z_IORequest;
127
128 typedef struct Z_IOTaskPackage
129 {
130     Z_IOOriginPartToKeep *originPart;          /* OPTIONAL */
131     Z_IOTargetPart *targetPart;
132 } Z_IOTaskPackage;
133
134 typedef struct Z_ItemOrder
135 {
136     int which;
137 #define Z_ItemOrder_esRequest 0
138 #define Z_ItemOrder_taskPackage 1
139     union
140     {
141         Z_IORequest *esRequest;
142         Z_IOTaskPackage *taskPackage;
143     } u;
144 } Z_ItemOrder;
145
146 int z_ItemOrder(ODR o, Z_ItemOrder **p, int opt);
147
148 #endif