Initial commit
[yaz4j-moved-to-github.git] / dependencies / yaz_3.0.14 / src / zes-pset.c
1 /** \file zes-pset.c
2     \brief ASN.1 Module ESFormat-PersistentResultSet
3
4     Generated automatically by YAZ ASN.1 Compiler 0.4
5 */
6
7 #include <yaz/zes-pset.h>
8
9 int z_PRPersistentResultSetEsRequest (ODR o, Z_PRPersistentResultSetEsRequest **p, int opt, const char *name)
10 {
11         if (!odr_sequence_begin (o, p, sizeof(**p), name))
12                 return odr_missing(o, opt, name) && odr_ok (o);
13         return
14                 odr_implicit_tag (o, odr_null,
15                         &(*p)->toKeep, ODR_CONTEXT, 1, 0, "toKeep") &&
16                 odr_explicit_tag (o, z_PROriginPartNotToKeep,
17                         &(*p)->notToKeep, ODR_CONTEXT, 2, 1, "notToKeep") &&
18                 odr_sequence_end (o);
19 }
20
21 int z_PRPersistentResultSetTaskPackage (ODR o, Z_PRPersistentResultSetTaskPackage **p, int opt, const char *name)
22 {
23         if (!odr_sequence_begin (o, p, sizeof(**p), name))
24                 return odr_missing(o, opt, name) && odr_ok (o);
25         return
26                 odr_implicit_tag (o, odr_null,
27                         &(*p)->originPart, ODR_CONTEXT, 1, 0, "originPart") &&
28                 odr_explicit_tag (o, z_PRTargetPart,
29                         &(*p)->targetPart, ODR_CONTEXT, 2, 1, "targetPart") &&
30                 odr_sequence_end (o);
31 }
32
33 int z_PRPersistentResultSet (ODR o, Z_PRPersistentResultSet **p, int opt, const char *name)
34 {
35         static Odr_arm arm[] = {
36                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PRPersistentResultSet_esRequest,
37                 (Odr_fun) z_PRPersistentResultSetEsRequest, "esRequest"},
38                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PRPersistentResultSet_taskPackage,
39                 (Odr_fun) z_PRPersistentResultSetTaskPackage, "taskPackage"},
40                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
41         };
42         if (!odr_initmember(o, p, sizeof(**p)))
43                 return odr_missing(o, opt, name);
44         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
45                 return 1;
46         if(o->direction == ODR_DECODE)
47                 *p = 0;
48         return odr_missing(o, opt, name);
49 }
50
51 int z_PROriginPartNotToKeep (ODR o, Z_PROriginPartNotToKeep **p, int opt, const char *name)
52 {
53         if (!odr_sequence_begin (o, p, sizeof(**p), name))
54                 return odr_missing(o, opt, name) && odr_ok (o);
55         return
56                 odr_implicit_tag (o, z_InternationalString,
57                         &(*p)->originSuppliedResultSet, ODR_CONTEXT, 1, 1, "originSuppliedResultSet") &&
58                 odr_implicit_tag (o, odr_integer,
59                         &(*p)->replaceOrAppend, ODR_CONTEXT, 2, 1, "replaceOrAppend") &&
60                 odr_sequence_end (o);
61 }
62
63 int z_PRTargetPart (ODR o, Z_PRTargetPart **p, int opt, const char *name)
64 {
65         if (!odr_sequence_begin (o, p, sizeof(**p), name))
66                 return odr_missing(o, opt, name) && odr_ok (o);
67         return
68                 odr_implicit_tag (o, z_InternationalString,
69                         &(*p)->targetSuppliedResultSet, ODR_CONTEXT, 1, 1, "targetSuppliedResultSet") &&
70                 odr_implicit_tag (o, odr_integer,
71                         &(*p)->numberOfRecords, ODR_CONTEXT, 2, 1, "numberOfRecords") &&
72                 odr_sequence_end (o);
73 }