2 * Copyright (c) 1998-1999, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.3 1999-11-30 13:47:11 adam
8 * Improved installation. Moved header files to include/yaz.
10 * Revision 1.2 1999/04/20 09:56:48 adam
11 * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun).
12 * Modified all encoders/decoders to reflect this change.
14 * Revision 1.1 1998/03/20 14:46:06 adam
15 * Added UNIverse Resource Reports.
19 #include <yaz/proto.h>
21 int z_UniverseReportHits (ODR o, Z_UniverseReportHits **p, int opt,
24 if (!odr_sequence_begin (o, p, sizeof(**p), 0))
25 return opt && odr_ok (o);
27 z_StringOrNumeric(o, &(*p)->database, 0, 0) &&
28 z_StringOrNumeric(o, &(*p)->hits, 0, 0) &&
32 int z_UniverseReportDuplicate (ODR o, Z_UniverseReportDuplicate **p, int opt,
35 if (!odr_sequence_begin (o, p, sizeof(**p), 0))
36 return opt && odr_ok (o);
38 z_StringOrNumeric(o, &(*p)->hitno, 0, 0) &&
42 int z_UniverseReport (ODR o, Z_UniverseReport **p, int opt, const char *name)
44 static Odr_arm arm[] = {
45 {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_UniverseReport_databaseHits,
46 (Odr_fun) z_UniverseReportHits, 0},
47 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_UniverseReport_duplicate,
48 (Odr_fun) z_UniverseReportDuplicate, 0},
49 {-1, -1, -1, -1, (Odr_fun) 0, 0}
51 if (!odr_sequence_begin (o, p, sizeof(**p), 0))
52 return opt && odr_ok (o);
54 odr_integer(o, &(*p)->totalHits, 0, 0) &&
55 odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) &&