X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=z39.50%2Fz-rrf2.c;fp=z39.50%2Fz-rrf2.c;h=09dd749e226cc05934a52e6da4ca470cebdb48a5;hb=69abdf35bf2cb6927d34b9fb1f526a0962f0fe8f;hp=0000000000000000000000000000000000000000;hpb=007a366af5ddaebf813e39588f1c09646d33bcef;p=yaz-moved-to-github.git diff --git a/z39.50/z-rrf2.c b/z39.50/z-rrf2.c new file mode 100644 index 0000000..09dd749 --- /dev/null +++ b/z39.50/z-rrf2.c @@ -0,0 +1,29 @@ +/* YC 0.2 Tue Feb 29 16:45:07 CET 2000 */ +/* Module-C: ResourceReport-Format-Resource-2 */ + +#include + +int z_ResourceReport2 (ODR o, Z_ResourceReport2 **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + 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, "estimates") || odr_ok(o)) && + odr_implicit_tag (o, z_InternationalString, + &(*p)->message, ODR_CONTEXT, 2, 1, "message") && + odr_sequence_end (o); +} + +int z_Estimate2 (ODR o, Z_Estimate2 **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->type, ODR_CONTEXT, 1, 0, "type") && + odr_implicit_tag (o, z_IntUnit, + &(*p)->value, ODR_CONTEXT, 2, 0, "value") && + odr_sequence_end (o); +}