source: trunk/gsdl/packages/yaz/asn/prt-univ.c@ 1343

Last change on this file since 1343 was 1343, checked in by johnmcp, 24 years ago

Added the YAZ toolkit source to the packages directory (for z39.50 stuff)

  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1/*
2 * Copyright (c) 1998-1999, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
5 *
6 * $Log$
7 * Revision 1.1 2000/08/03 03:09:53 johnmcp
8 * Added the YAZ toolkit source to the packages directory (for z39.50 stuff)
9 *
10 * Revision 1.3 1999/11/30 13:47:11 adam
11 * Improved installation. Moved header files to include/yaz.
12 *
13 * Revision 1.2 1999/04/20 09:56:48 adam
14 * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun).
15 * Modified all encoders/decoders to reflect this change.
16 *
17 * Revision 1.1 1998/03/20 14:46:06 adam
18 * Added UNIverse Resource Reports.
19 *
20 */
21
22#include <yaz/proto.h>
23
24int z_UniverseReportHits (ODR o, Z_UniverseReportHits **p, int opt,
25 const char *name)
26{
27 if (!odr_sequence_begin (o, p, sizeof(**p), 0))
28 return opt && odr_ok (o);
29 return
30 z_StringOrNumeric(o, &(*p)->database, 0, 0) &&
31 z_StringOrNumeric(o, &(*p)->hits, 0, 0) &&
32 odr_sequence_end (o);
33}
34
35int z_UniverseReportDuplicate (ODR o, Z_UniverseReportDuplicate **p, int opt,
36 const char *name)
37{
38 if (!odr_sequence_begin (o, p, sizeof(**p), 0))
39 return opt && odr_ok (o);
40 return
41 z_StringOrNumeric(o, &(*p)->hitno, 0, 0) &&
42 odr_sequence_end (o);
43}
44
45int z_UniverseReport (ODR o, Z_UniverseReport **p, int opt, const char *name)
46{
47 static Odr_arm arm[] = {
48 {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_UniverseReport_databaseHits,
49 (Odr_fun) z_UniverseReportHits, 0},
50 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_UniverseReport_duplicate,
51 (Odr_fun) z_UniverseReportDuplicate, 0},
52 {-1, -1, -1, -1, (Odr_fun) 0, 0}
53 };
54 if (!odr_sequence_begin (o, p, sizeof(**p), 0))
55 return opt && odr_ok (o);
56 return
57 odr_integer(o, &(*p)->totalHits, 0, 0) &&
58 odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) &&
59 odr_sequence_end (o);
60}
61
Note: See TracBrowser for help on using the repository browser.