Resource control
[yaz-moved-to-github.git] / asn / prt-rsc.c
1 /*
2  * Copyright (c) 1995, Index Data.
3  * See the file LICENSE for details.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: prt-rsc.c,v $
7  * Revision 1.1  1995-06-01 11:22:17  quinn
8  * Resource control
9  *
10  *
11  */
12
13 #include <proto.h>
14
15 /* -------------------- Resource 1 ------------------------- */
16
17 int z_Estimate1(ODR o, Z_Estimate1, int opt)
18 {
19     if (!odr_sequence_begin(o, p, sizeof(**p)))
20         return opt && odr_ok(o);
21     return
22         odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 1, 0) &&
23         odr_implicit(o, odr_integer, &(*p)->value, ODR_CONTEXT, 2, 0) &&
24         odr_implicit(o, odr_integer, &(*p)->currencyCode, ODR_CONTEXT, 3, 1) &&
25         odr_sequence-end(o);
26 }
27
28 int z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt)
29 {
30     if (!odr_sequence_begin(o, p, sizeof(**p)))
31         return opt && odr_ok(o);
32     return
33         odr_implicit_settag(o, ODR_CONTEXT, 1) &&
34         odr_sequence_of(o, z_Estimate1, &(*p)->estimates,
35             &(*p)->num_estimates) &&
36         odr_implicit(o, odr_visiblestring, &(*p)->message, ODR_CONTEXT, 2, 0) &&
37         odr_sequence_end(o);
38 }
39
40 /* -------------------- Resource 1 ------------------------- */
41