X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=asn%2Fprt-rsc.c;h=db690eed6ece856b5974d57b7209711a3e8b0d71;hb=03c1d6e9c2c2c0bb2ee01e38d7f464a311bfe9e9;hp=efec5e4705af07f2c396db8f2d21b1bae130aee9;hpb=657fb99115b87a5244e9a33bbe4ca3d9d18849c4;p=yaz-moved-to-github.git diff --git a/asn/prt-rsc.c b/asn/prt-rsc.c index efec5e4..db690ee 100644 --- a/asn/prt-rsc.c +++ b/asn/prt-rsc.c @@ -1,10 +1,23 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-rsc.c,v $ - * Revision 1.4 1995-09-27 15:02:43 quinn + * Revision 1.8 1999-11-30 13:47:11 adam + * Improved installation. Moved header files to include/yaz. + * + * Revision 1.7 1999/04/20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.6 1998/02/11 11:53:32 adam + * Changed code so that it compiles as C++. + * + * Revision 1.5 1995/09/29 17:11:55 quinn + * Smallish + * + * Revision 1.4 1995/09/27 15:02:43 quinn * Modified function heads & prototypes. * * Revision 1.3 1995/06/02 09:49:15 quinn @@ -19,13 +32,13 @@ * */ -#include +#include /* -------------------- Resource 1 ------------------------- */ -int z_Estimate1(ODR o, Z_Estimate1 **p, int opt) +int z_Estimate1(ODR o, Z_Estimate1 **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 1, 0) && @@ -34,26 +47,27 @@ int z_Estimate1(ODR o, Z_Estimate1 **p, int opt) odr_sequence_end(o); } -int MDF z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt) +int z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit_settag(o, ODR_CONTEXT, 1) && - odr_sequence_of(o, z_Estimate1, &(*p)->estimates, - &(*p)->num_estimates) && - odr_implicit(o, odr_visiblestring, &(*p)->message, ODR_CONTEXT, 2, 0) && + odr_sequence_of(o, (Odr_fun)z_Estimate1, &(*p)->estimates, + &(*p)->num_estimates, 0) && + odr_implicit(o, odr_visiblestring, &(*p)->message, + ODR_CONTEXT, 2, 0) && odr_sequence_end(o); } /* -------------------- Resource 2 ------------------------- */ -int z_StringOrNumeric(ODR, Z_StringOrNumeric **, int); -int z_IntUnit(ODR, Z_IntUnit **, int); +/* int z_StringOrNumeric(ODR, Z_StringOrNumeric **, int); */ +/* int z_IntUnit(ODR, Z_IntUnit **, int); */ -int z_Estimate2(ODR o, Z_Estimate2 **p, int opt) +int z_Estimate2(ODR o, Z_Estimate2 **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_explicit(o, z_StringOrNumeric, &(*p)->type, ODR_CONTEXT, 1, 0) && @@ -61,16 +75,17 @@ int z_Estimate2(ODR o, Z_Estimate2 **p, int opt) odr_sequence_end(o); } -int MDF z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt) +int z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt, const char *name) { -if (!odr_sequence_begin(o, p, sizeof(**p))) - return opt && odr_ok(o); -return - odr_implicit_settag(o, ODR_CONTEXT, 1) && - (odr_sequence_of(o, z_Estimate2, &(*p)->estimates, - &(*p)->num_estimates) || odr_ok(o)) && - odr_implicit(o, odr_visiblestring, &(*p)->message, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) + return opt && odr_ok(o); + return + odr_implicit_settag(o, ODR_CONTEXT, 1) && + (odr_sequence_of(o, (Odr_fun)z_Estimate2, &(*p)->estimates, + &(*p)->num_estimates, 0) || odr_ok(o)) && + odr_implicit(o, odr_visiblestring, &(*p)->message, + ODR_CONTEXT, 2, 1) && + odr_sequence_end(o); }