Avoid redundant YAZ includes.
[yaz4j-moved-to-github.git] / dependencies / yaz-2.1.28 / src / zes-pquery.c
1 /** \file zes-pquery.c
2     \brief ASN.1 Module ESFormat-PersistentQuery
3
4     Generated automatically by YAZ ASN.1 Compiler 0.4
5 */
6
7 #include <yaz/zes-pquery.h>
8
9 int z_PQueryPersistentQueryEsRequest (ODR o, Z_PQueryPersistentQueryEsRequest **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_explicit_tag (o, z_PQueryOriginPartToKeep,
15                         &(*p)->toKeep, ODR_CONTEXT, 1, 1, "toKeep") &&
16                 odr_explicit_tag (o, z_PQueryOriginPartNotToKeep,
17                         &(*p)->notToKeep, ODR_CONTEXT, 2, 0, "notToKeep") &&
18                 odr_sequence_end (o);
19 }
20
21 int z_PQueryPersistentQueryTaskPackage (ODR o, Z_PQueryPersistentQueryTaskPackage **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_explicit_tag (o, z_PQueryOriginPartToKeep,
27                         &(*p)->originPart, ODR_CONTEXT, 1, 1, "originPart") &&
28                 odr_explicit_tag (o, z_PQueryTargetPart,
29                         &(*p)->targetPart, ODR_CONTEXT, 2, 0, "targetPart") &&
30                 odr_sequence_end (o);
31 }
32
33 int z_PQueryPersistentQuery (ODR o, Z_PQueryPersistentQuery **p, int opt, const char *name)
34 {
35         static Odr_arm arm[] = {
36                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PQueryPersistentQuery_esRequest,
37                 (Odr_fun) z_PQueryPersistentQueryEsRequest, "esRequest"},
38                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PQueryPersistentQuery_taskPackage,
39                 (Odr_fun) z_PQueryPersistentQueryTaskPackage, "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_PQueryOriginPartToKeep (ODR o, Z_PQueryOriginPartToKeep **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_settag (o, ODR_CONTEXT, 2) &&
57                 (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->dbNames,
58                   &(*p)->num_dbNames, "dbNames") || odr_ok(o)) &&
59                 odr_explicit_tag (o, z_OtherInformation,
60                         &(*p)->additionalSearchInfo, ODR_CONTEXT, 3, 1, "additionalSearchInfo") &&
61                 odr_sequence_end (o);
62 }
63
64 int z_PQueryOriginPartNotToKeep (ODR o, Z_PQueryOriginPartNotToKeep **p, int opt, const char *name)
65 {
66         static Odr_arm arm[] = {
67                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PQueryOriginPartNotToKeep_package,
68                 (Odr_fun) z_InternationalString, "package"},
69                 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_PQueryOriginPartNotToKeep_query,
70                 (Odr_fun) z_Query, "query"},
71                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
72         };
73         if (!odr_initmember(o, p, sizeof(**p)))
74                 return odr_missing(o, opt, name);
75         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
76                 return 1;
77         if(o->direction == ODR_DECODE)
78                 *p = 0;
79         return odr_missing(o, opt, name);
80 }
81
82 int z_PQueryTargetPart (ODR o, Z_PQueryTargetPart **p, int opt, const char *name)
83 {
84         return z_Query (o, p, opt, name);
85 }