2 * Copyright (c) 1995-1999, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.8 1999-11-30 13:47:11 adam
8 * Improved installation. Moved header files to include/yaz.
10 * Revision 1.7 1999/04/20 09:56:48 adam
11 * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun).
12 * Modified all encoders/decoders to reflect this change.
14 * Revision 1.6 1998/02/11 11:53:32 adam
15 * Changed code so that it compiles as C++.
17 * Revision 1.5 1995/09/29 17:11:55 quinn
20 * Revision 1.4 1995/09/27 15:02:43 quinn
21 * Modified function heads & prototypes.
23 * Revision 1.3 1995/06/02 09:49:15 quinn
24 * Adding access control
26 * Revision 1.2 1995/06/01 14:34:53 quinn
29 * Revision 1.1 1995/06/01 11:22:17 quinn
35 #include <yaz/proto.h>
37 /* -------------------- Resource 1 ------------------------- */
39 int z_Estimate1(ODR o, Z_Estimate1 **p, int opt, const char *name)
41 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
42 return opt && odr_ok(o);
44 odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 1, 0) &&
45 odr_implicit(o, odr_integer, &(*p)->value, ODR_CONTEXT, 2, 0) &&
46 odr_implicit(o, odr_integer, &(*p)->currencyCode, ODR_CONTEXT, 3, 1) &&
50 int z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt, const char *name)
52 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
53 return opt && odr_ok(o);
55 odr_implicit_settag(o, ODR_CONTEXT, 1) &&
56 odr_sequence_of(o, (Odr_fun)z_Estimate1, &(*p)->estimates,
57 &(*p)->num_estimates, 0) &&
58 odr_implicit(o, odr_visiblestring, &(*p)->message,
63 /* -------------------- Resource 2 ------------------------- */
65 /* int z_StringOrNumeric(ODR, Z_StringOrNumeric **, int); */
66 /* int z_IntUnit(ODR, Z_IntUnit **, int); */
68 int z_Estimate2(ODR o, Z_Estimate2 **p, int opt, const char *name)
70 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
71 return opt && odr_ok(o);
73 odr_explicit(o, z_StringOrNumeric, &(*p)->type, ODR_CONTEXT, 1, 0) &&
74 odr_implicit(o, z_IntUnit, &(*p)->value, ODR_CONTEXT, 2, 0) &&
78 int z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt, const char *name)
80 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
81 return opt && odr_ok(o);
83 odr_implicit_settag(o, ODR_CONTEXT, 1) &&
84 (odr_sequence_of(o, (Odr_fun)z_Estimate2, &(*p)->estimates,
85 &(*p)->num_estimates, 0) || odr_ok(o)) &&
86 odr_implicit(o, odr_visiblestring, &(*p)->message,