2 * Copyright (c) 1995-1999, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.7 1999-04-20 09:56:48 adam
8 * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun).
9 * Modified all encoders/decoders to reflect this change.
11 * Revision 1.6 1998/02/11 11:53:32 adam
12 * Changed code so that it compiles as C++.
14 * Revision 1.5 1995/09/29 17:11:55 quinn
17 * Revision 1.4 1995/09/27 15:02:43 quinn
18 * Modified function heads & prototypes.
20 * Revision 1.3 1995/06/02 09:49:15 quinn
21 * Adding access control
23 * Revision 1.2 1995/06/01 14:34:53 quinn
26 * Revision 1.1 1995/06/01 11:22:17 quinn
34 /* -------------------- Resource 1 ------------------------- */
36 int z_Estimate1(ODR o, Z_Estimate1 **p, int opt, const char *name)
38 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
39 return opt && odr_ok(o);
41 odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 1, 0) &&
42 odr_implicit(o, odr_integer, &(*p)->value, ODR_CONTEXT, 2, 0) &&
43 odr_implicit(o, odr_integer, &(*p)->currencyCode, ODR_CONTEXT, 3, 1) &&
47 int z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt, const char *name)
49 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
50 return opt && odr_ok(o);
52 odr_implicit_settag(o, ODR_CONTEXT, 1) &&
53 odr_sequence_of(o, (Odr_fun)z_Estimate1, &(*p)->estimates,
54 &(*p)->num_estimates, 0) &&
55 odr_implicit(o, odr_visiblestring, &(*p)->message,
60 /* -------------------- Resource 2 ------------------------- */
62 /* int z_StringOrNumeric(ODR, Z_StringOrNumeric **, int); */
63 /* int z_IntUnit(ODR, Z_IntUnit **, int); */
65 int z_Estimate2(ODR o, Z_Estimate2 **p, int opt, const char *name)
67 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
68 return opt && odr_ok(o);
70 odr_explicit(o, z_StringOrNumeric, &(*p)->type, ODR_CONTEXT, 1, 0) &&
71 odr_implicit(o, z_IntUnit, &(*p)->value, ODR_CONTEXT, 2, 0) &&
75 int z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt, const char *name)
77 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
78 return opt && odr_ok(o);
80 odr_implicit_settag(o, ODR_CONTEXT, 1) &&
81 (odr_sequence_of(o, (Odr_fun)z_Estimate2, &(*p)->estimates,
82 &(*p)->num_estimates, 0) || odr_ok(o)) &&
83 odr_implicit(o, odr_visiblestring, &(*p)->message,