2 * Copyright (c) 1995-1998, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.6 1998-01-05 09:04:57 adam
8 * Fixed bugs in encoders/decoders - Not operator (!) missing.
10 * Revision 1.5 1997/04/30 08:52:02 quinn
13 * Revision 1.4 1996/10/10 12:35:12 quinn
14 * Added Update extended service.
16 * Revision 1.3 1995/09/29 17:11:54 quinn
19 * Revision 1.2 1995/09/27 15:02:41 quinn
20 * Modified function heads & prototypes.
22 * Revision 1.1 1995/08/21 09:16:32 quinn
23 * Added Extended services + Item Order
30 int z_TaskPackage(ODR o, Z_TaskPackage **p, int opt)
32 if (!odr_sequence_begin(o, p, sizeof(**p)))
33 return opt && odr_ok(o);
35 odr_implicit(o, odr_oid, &(*p)->packageType, ODR_CONTEXT, 1, 0) &&
36 odr_implicit(o, z_InternationalString, &(*p)->packageName, ODR_CONTEXT,
38 odr_implicit(o, z_InternationalString, &(*p)->userId, ODR_CONTEXT,
40 odr_implicit(o, z_IntUnit, &(*p)->retentionTime, ODR_CONTEXT, 4, 1) &&
41 odr_implicit(o, z_Permissions, &(*p)->permissions, ODR_CONTEXT, 5, 1) &&
42 odr_implicit(o, z_InternationalString, &(*p)->description, ODR_CONTEXT,
44 odr_implicit(o, odr_octetstring, &(*p)->targetReference, ODR_CONTEXT,
46 odr_implicit(o, odr_generalizedtime, &(*p)->creationDateTime,
49 odr_implicit(o, odr_integer, &(*p)->taskStatus, ODR_CONTEXT, 9, 0) &&
50 odr_implicit_settag(o, ODR_CONTEXT, 10) &&
51 (odr_sequence_of(o, z_DiagRec, &(*p)->packageDiagnostics,
52 &(*p)->num_packageDiagnostics) || odr_ok(o)) &&
53 odr_implicit(o, z_External, &(*p)->taskSpecificParameters, ODR_CONTEXT,
58 /* ----------------------- ITEM ORDER --------------------- */
60 int z_IOTargetPart(ODR o, Z_IOTargetPart **p, int opt)
62 if (!odr_sequence_begin(o, p, sizeof(**p)))
63 return opt && odr_ok(o);
65 odr_implicit(o, z_External, &(*p)->itemRequest, ODR_CONTEXT, 1, 1) &&
66 odr_implicit(o, z_External, &(*p)->statusOrErrorReport, ODR_CONTEXT,
68 odr_implicit(o, odr_integer, &(*p)->auxiliaryStatus, ODR_CONTEXT,
73 int z_IOResultSetItem(ODR o, Z_IOResultSetItem **p, int opt)
75 if (!odr_sequence_begin(o, p, sizeof(**p)))
76 return opt && odr_ok(o);
78 odr_implicit(o, z_InternationalString, &(*p)->resultSetId, ODR_CONTEXT,
80 odr_implicit(o, odr_integer, &(*p)->item, ODR_CONTEXT, 2, 1) &&
84 int z_IOOriginPartNotToKeep(ODR o, Z_IOOriginPartNotToKeep **p, int opt)
86 if (!odr_sequence_begin(o, p, sizeof(**p)))
87 return opt && odr_ok(o);
89 odr_implicit(o, z_IOResultSetItem, &(*p)->resultSetItem, ODR_CONTEXT,
91 odr_implicit(o, z_External, &(*p)->itemRequest, ODR_CONTEXT, 2, 1) &&
95 int z_IOContact(ODR o, Z_IOContact **p, int opt)
97 if (!odr_sequence_begin(o, p, sizeof(**p)))
98 return opt && odr_ok(o);
100 odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT,
102 odr_implicit(o, z_InternationalString, &(*p)->phone, ODR_CONTEXT,
104 odr_implicit(o, z_InternationalString, &(*p)->email, ODR_CONTEXT,
109 int z_IOCreditCardInfo(ODR o, Z_IOCreditCardInfo **p, int opt)
111 if (!odr_sequence_begin(o, p, sizeof(**p)))
112 return opt && odr_ok(o);
114 odr_implicit(o, z_InternationalString, &(*p)->nameOnCard, ODR_CONTEXT,
116 odr_implicit(o, z_InternationalString, &(*p)->expirationDate,
117 ODR_CONTEXT, 2, 0) &&
118 odr_implicit(o, z_InternationalString, &(*p)->cardNumber, ODR_CONTEXT,
123 int z_IOBilling(ODR o, Z_IOBilling **p, int opt)
125 static Odr_arm arm[] =
127 {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_IOBilling_billInvoice, odr_null},
128 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IOBilling_prepay, odr_null},
129 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IOBilling_depositAccount, odr_null},
130 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IOBilling_creditCard,
132 {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_IOBilling_cardInfoPreviouslySupplied,
134 {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_IOBilling_privateKnown, odr_null},
135 {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_IOBilling_privateNotKnown,
140 if (!odr_sequence_begin(o, p, sizeof(**p)))
141 return opt && odr_ok(o);
143 odr_constructed_begin(o, &(*p)->paymentMethod,
145 odr_choice(o, arm, &(*p)->paymentMethod, &(*p)->which) &&
146 odr_constructed_end(o) &&
147 odr_implicit(o, z_InternationalString, &(*p)->customerReference,
148 ODR_CONTEXT, 2, 1) &&
149 odr_implicit(o, z_InternationalString, &(*p)->customerPONumber,
150 ODR_CONTEXT, 3, 1) &&
154 int z_IOOriginPartToKeep(ODR o, Z_IOOriginPartToKeep **p, int opt)
156 if (!odr_sequence_begin(o, p, sizeof(**p)))
157 return opt && odr_ok(o);
159 odr_implicit(o, z_External, &(*p)->supplDescription, ODR_CONTEXT,
161 odr_implicit(o, z_IOContact, &(*p)->contact, ODR_CONTEXT, 2, 1) &&
162 odr_implicit(o, z_IOBilling, &(*p)->addlBilling, ODR_CONTEXT,
167 int z_IORequest(ODR o, Z_IORequest **p, int opt)
169 if (!odr_sequence_begin(o, p, sizeof(**p)))
170 return opt && odr_ok(o);
172 odr_implicit(o, z_IOOriginPartToKeep, &(*p)->toKeep, ODR_CONTEXT,
174 odr_implicit(o, z_IOOriginPartNotToKeep, &(*p)->notToKeep, ODR_CONTEXT,
179 int z_IOTaskPackage(ODR o, Z_IOTaskPackage **p, int opt)
181 if (!odr_sequence_begin(o, p, sizeof(**p)))
182 return opt && odr_ok(o);
184 odr_implicit(o, z_IOOriginPartToKeep, &(*p)->originPart, ODR_CONTEXT,
186 odr_implicit(o, z_IOTargetPart, &(*p)->targetPart, ODR_CONTEXT, 2, 0) &&
190 int z_ItemOrder(ODR o, Z_ItemOrder **p, int opt)
192 static Odr_arm arm[] =
194 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ItemOrder_esRequest, z_IORequest},
195 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ItemOrder_taskPackage,
200 if (o->direction == ODR_DECODE)
201 *p = odr_malloc(o, sizeof(**p));
204 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
207 return opt && odr_ok(o);
210 /* ----------------------- ITEM UPDATE -------------------- */
212 int z_IUSuppliedRecordsId (ODR o, Z_IUSuppliedRecordsId **p, int opt)
214 static Odr_arm arm[] = {
215 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUSuppliedRecordsId_timeStamp,
216 odr_generalizedtime},
217 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IUSuppliedRecordsId_versionNumber,
218 z_InternationalString},
219 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IUSuppliedRecordsId_previousVersion,
223 if (!odr_initmember(o, p, sizeof(**p)))
224 return opt && odr_ok(o);
225 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
228 return opt && odr_ok(o);
231 int z_IUCorrelationInfo (ODR o, Z_IUCorrelationInfo **p, int opt)
233 if (!odr_sequence_begin (o, p, sizeof(**p)))
234 return opt && odr_ok (o);
236 odr_implicit (o, z_InternationalString,
237 &(*p)->note, ODR_CONTEXT, 1, 1) &&
238 odr_implicit (o, odr_integer,
239 &(*p)->id, ODR_CONTEXT, 2, 1) &&
240 odr_sequence_end (o);
243 int z_IUSuppliedRecords_elem (ODR o, Z_IUSuppliedRecords_elem **p, int opt)
245 static Odr_arm arm[] = {
246 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUSuppliedRecords_number,
248 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IUSuppliedRecords_string,
249 z_InternationalString},
250 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IUSuppliedRecords_opaque,
254 if (!odr_sequence_begin (o, p, sizeof(**p)))
255 return opt && odr_ok (o);
257 ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1) &&
258 odr_choice (o, arm, &(*p)->u, &(*p)->which) &&
259 odr_constructed_end (o)) || odr_ok(o)) &&
260 odr_explicit (o, z_IUSuppliedRecordsId,
261 &(*p)->supplementalId, ODR_CONTEXT, 2, 1) &&
262 odr_implicit (o, z_IUCorrelationInfo,
263 &(*p)->correlationInfo, ODR_CONTEXT, 3, 1) &&
264 odr_implicit (o, odr_external,
265 &(*p)->record, ODR_CONTEXT, 4, 0) &&
266 odr_sequence_end (o);
269 int z_IUSuppliedRecords (ODR o, Z_IUSuppliedRecords **p, int opt)
271 if (!odr_initmember (o, p, sizeof(**p)))
272 return opt && odr_ok(o);
273 if (odr_sequence_of (o, z_IUSuppliedRecords_elem, &(*p)->elements,
277 return opt && odr_ok(o);
280 int z_IUTaskPackageRecordStructure (ODR o, Z_IUTaskPackageRecordStructure **p,
283 static Odr_arm arm[] = {
284 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUTaskPackageRecordStructure_record,
286 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_IUTaskPackageRecordStructure_diagnostic,
290 if (!odr_sequence_begin (o, p, sizeof(**p)))
291 return opt && odr_ok (o);
293 ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1) &&
294 odr_choice (o, arm, &(*p)->u, &(*p)->which) &&
295 odr_constructed_end (o)) || odr_ok(o)) &&
296 odr_implicit (o, z_IUCorrelationInfo,
297 &(*p)->correlationInfo, ODR_CONTEXT, 2, 1) &&
298 odr_implicit (o, odr_integer,
299 &(*p)->recordStatus, ODR_CONTEXT, 3, 0) &&
300 odr_sequence_end (o);
303 int z_IUOriginPartToKeep (ODR o, Z_IUOriginPartToKeep **p, int opt)
305 if (!odr_sequence_begin (o, p, sizeof(**p)))
306 return opt && odr_ok (o);
308 odr_implicit (o, odr_integer,
309 &(*p)->action, ODR_CONTEXT, 1, 0) &&
310 odr_implicit (o, z_InternationalString,
311 &(*p)->databaseName, ODR_CONTEXT, 2, 0) &&
312 odr_implicit (o, odr_oid,
313 &(*p)->schema, ODR_CONTEXT, 3, 1) &&
314 odr_implicit (o, z_InternationalString,
315 &(*p)->elementSetName, ODR_CONTEXT, 4, 1) &&
316 odr_sequence_end (o);
319 int z_IUTargetPart (ODR o, Z_IUTargetPart **p, int opt)
321 if (!odr_sequence_begin (o, p, sizeof(**p)))
322 return opt && odr_ok (o);
324 odr_implicit (o, odr_integer,
325 &(*p)->updateStatus, ODR_CONTEXT, 1, 0) &&
326 odr_implicit_settag (o, ODR_CONTEXT, 2) &&
327 (odr_sequence_of(o, z_DiagRec, &(*p)->globalDiagnostics,
328 &(*p)->num_globalDiagnostics) || odr_ok(o)) &&
329 odr_implicit_settag (o, ODR_CONTEXT, 3) &&
330 odr_sequence_of(o, z_IUTaskPackageRecordStructure, &(*p)->taskPackageRecords,
331 &(*p)->num_taskPackageRecords) &&
332 odr_sequence_end (o);
335 int z_IUUpdateEsRequest (ODR o, Z_IUUpdateEsRequest **p, int opt)
337 if (!odr_sequence_begin (o, p, sizeof(**p)))
338 return opt && odr_ok (o);
340 odr_explicit (o, z_IUOriginPartToKeep,
341 &(*p)->toKeep, ODR_CONTEXT, 1, 0) &&
342 odr_explicit (o, z_IUSuppliedRecords,
343 &(*p)->notToKeep, ODR_CONTEXT, 2, 0) &&
344 odr_sequence_end (o);
347 int z_IUUpdateTaskPackage (ODR o, Z_IUUpdateTaskPackage **p, int opt)
349 if (!odr_sequence_begin (o, p, sizeof(**p)))
350 return opt && odr_ok (o);
352 odr_explicit (o, z_IUOriginPartToKeep,
353 &(*p)->originPart, ODR_CONTEXT, 1, 0) &&
354 odr_explicit (o, z_IUTargetPart,
355 &(*p)->targetPart, ODR_CONTEXT, 2, 0) &&
356 odr_sequence_end (o);
359 int z_IUUpdate (ODR o, Z_IUUpdate **p, int opt)
361 static Odr_arm arm[] = {
362 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUUpdate_esRequest,
363 z_IUUpdateEsRequest},
364 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IUUpdate_taskPackage,
365 z_IUUpdateTaskPackage},
368 if (!odr_initmember(o, p, sizeof(**p)))
369 return opt && odr_ok(o);
370 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
373 return opt && odr_ok(o);