X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=asn%2Fprt-univ.c;h=b61052f448cacb32f3a48e02987a8fde785c791d;hp=427d13d21895ce5b47aef31ff440ecf10d5122d6;hb=a040a2caa54445509bb70c14b57dffe3bbd0fcf4;hpb=84b60b9a8d2052540541726390fde416c59e1f40 diff --git a/asn/prt-univ.c b/asn/prt-univ.c index 427d13d..b61052f 100644 --- a/asn/prt-univ.c +++ b/asn/prt-univ.c @@ -1,52 +1,58 @@ /* - * Copyright (c) 1998, Index Data. + * Copyright (c) 1998-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-univ.c,v $ - * Revision 1.1 1998-03-20 14:46:06 adam + * Revision 1.3 1999-11-30 13:47:11 adam + * Improved installation. Moved header files to include/yaz. + * + * Revision 1.2 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.1 1998/03/20 14:46:06 adam * Added UNIverse Resource Reports. * */ -#include - -/* YC 0.1 Fri Mar 20 14:28:54 CET 1998 */ -/* Module-C: ResourceReport-Format-Universe-1 */ +#include -int z_UniverseReportHits (ODR o, Z_UniverseReportHits **p, int opt) +int z_UniverseReportHits (ODR o, Z_UniverseReportHits **p, int opt, + const char *name) { - if (!odr_sequence_begin (o, p, sizeof(**p))) - return opt && odr_ok (o); - return - z_StringOrNumeric(o, &(*p)->database, 0) && - z_StringOrNumeric(o, &(*p)->hits, 0) && - odr_sequence_end (o); + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) + return opt && odr_ok (o); + return + z_StringOrNumeric(o, &(*p)->database, 0, 0) && + z_StringOrNumeric(o, &(*p)->hits, 0, 0) && + odr_sequence_end (o); } -int z_UniverseReportDuplicate (ODR o, Z_UniverseReportDuplicate **p, int opt) +int z_UniverseReportDuplicate (ODR o, Z_UniverseReportDuplicate **p, int opt, + const char *name) { - if (!odr_sequence_begin (o, p, sizeof(**p))) - return opt && odr_ok (o); - return - z_StringOrNumeric(o, &(*p)->hitno, 0) && - odr_sequence_end (o); + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) + return opt && odr_ok (o); + return + z_StringOrNumeric(o, &(*p)->hitno, 0, 0) && + odr_sequence_end (o); } -int z_UniverseReport (ODR o, Z_UniverseReport **p, int opt) +int z_UniverseReport (ODR o, Z_UniverseReport **p, int opt, const char *name) { - static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_UniverseReport_databaseHits, - (Odr_fun) z_UniverseReportHits}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_UniverseReport_duplicate, - (Odr_fun) z_UniverseReportDuplicate}, - {-1, -1, -1, -1, (Odr_fun) 0} - }; - if (!odr_sequence_begin (o, p, sizeof(**p))) - return opt && odr_ok (o); - return - odr_integer(o, &(*p)->totalHits, 0) && - odr_choice (o, arm, &(*p)->u, &(*p)->which) && - odr_sequence_end (o); + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_UniverseReport_databaseHits, + (Odr_fun) z_UniverseReportHits, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_UniverseReport_duplicate, + (Odr_fun) z_UniverseReportDuplicate, 0}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) + return opt && odr_ok (o); + return + odr_integer(o, &(*p)->totalHits, 0, 0) && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_sequence_end (o); }