X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=asn%2Fprt-rsc.c;h=db690eed6ece856b5974d57b7209711a3e8b0d71;hb=006c3df264a95c03bfc557b2004595fc6cc3ee14;hp=a7466f830df77f807a8e2dac06af04db0367e81a;hpb=63cafe41a93427118959a74201b3e331169a71d9;p=yaz-moved-to-github.git diff --git a/asn/prt-rsc.c b/asn/prt-rsc.c index a7466f8..db690ee 100644 --- a/asn/prt-rsc.c +++ b/asn/prt-rsc.c @@ -1,10 +1,20 @@ /* - * 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.5 1995-09-29 17:11:55 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 @@ -22,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) && @@ -37,26 +47,27 @@ int z_Estimate1(ODR o, Z_Estimate1 **p, int opt) odr_sequence_end(o); } -int 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) && @@ -64,16 +75,17 @@ int z_Estimate2(ODR o, Z_Estimate2 **p, int opt) odr_sequence_end(o); } -int 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); }