Avoid redundant YAZ includes.
[yaz4j-moved-to-github.git] / dependencies / yaz-2.1.28 / src / zes-psched.c
1 /** \file zes-psched.c
2     \brief ASN.1 Module ESFormat-PeriodicQuerySchedule
3
4     Generated automatically by YAZ ASN.1 Compiler 0.4
5 */
6
7 #include <yaz/zes-psched.h>
8
9 int z_PQSPeriodicQueryScheduleEsRequest (ODR o, Z_PQSPeriodicQueryScheduleEsRequest **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_PQSOriginPartToKeep,
15                         &(*p)->toKeep, ODR_CONTEXT, 1, 0, "toKeep") &&
16                 odr_explicit_tag (o, z_PQSOriginPartNotToKeep,
17                         &(*p)->notToKeep, ODR_CONTEXT, 2, 0, "notToKeep") &&
18                 odr_sequence_end (o);
19 }
20
21 int z_PQSPeriodicQueryScheduleTaskPackage (ODR o, Z_PQSPeriodicQueryScheduleTaskPackage **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_PQSOriginPartToKeep,
27                         &(*p)->originPart, ODR_CONTEXT, 1, 0, "originPart") &&
28                 odr_explicit_tag (o, z_PQSTargetPart,
29                         &(*p)->targetPart, ODR_CONTEXT, 2, 0, "targetPart") &&
30                 odr_sequence_end (o);
31 }
32
33 int z_PQSPeriodicQuerySchedule (ODR o, Z_PQSPeriodicQuerySchedule **p, int opt, const char *name)
34 {
35         static Odr_arm arm[] = {
36                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PQSPeriodicQuerySchedule_esRequest,
37                 (Odr_fun) z_PQSPeriodicQueryScheduleEsRequest, "esRequest"},
38                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PQSPeriodicQuerySchedule_taskPackage,
39                 (Odr_fun) z_PQSPeriodicQueryScheduleTaskPackage, "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_PQSOriginPartToKeep (ODR o, Z_PQSOriginPartToKeep **p, int opt, const char *name)
52 {
53         static Odr_arm arm[] = {
54                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PQSOriginPartToKeep_packageName,
55                 (Odr_fun) z_InternationalString, "packageName"},
56                 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_PQSOriginPartToKeep_exportPackage,
57                 (Odr_fun) z_ESExportSpecification, "exportPackage"},
58                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
59         };
60         if (!odr_sequence_begin (o, p, sizeof(**p), name))
61                 return odr_missing(o, opt, name) && odr_ok (o);
62         return
63                 odr_implicit_tag (o, odr_bool,
64                         &(*p)->activeFlag, ODR_CONTEXT, 1, 0, "activeFlag") &&
65                 odr_implicit_settag (o, ODR_CONTEXT, 2) &&
66                 (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->databaseNames,
67                   &(*p)->num_databaseNames, "databaseNames") || odr_ok(o)) &&
68                 odr_implicit_tag (o, odr_integer,
69                         &(*p)->resultSetDisposition, ODR_CONTEXT, 3, 1, "resultSetDisposition") &&
70                 odr_explicit_tag (o, z_ESDestination,
71                         &(*p)->alertDestination, ODR_CONTEXT, 4, 1, "alertDestination") &&
72                 ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 5, "exportParameters") &&
73                 odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) &&
74                 odr_constructed_end (o)) || odr_ok(o)) &&
75                 odr_sequence_end (o);
76 }
77
78 int z_PQSOriginPartNotToKeep (ODR o, Z_PQSOriginPartNotToKeep **p, int opt, const char *name)
79 {
80         static Odr_arm arm[] = {
81                 {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_PQSOriginPartNotToKeep_actualQuery,
82                 (Odr_fun) z_Query, "actualQuery"},
83                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PQSOriginPartNotToKeep_packageName,
84                 (Odr_fun) z_InternationalString, "packageName"},
85                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
86         };
87         if (!odr_sequence_begin (o, p, sizeof(**p), name))
88                 return odr_missing(o, opt, name) && odr_ok (o);
89         return
90                 ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, "querySpec") &&
91                 odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) &&
92                 odr_constructed_end (o)) || odr_ok(o)) &&
93                 odr_explicit_tag (o, z_PQSPeriod,
94                         &(*p)->originSuggestedPeriod, ODR_CONTEXT, 2, 1, "originSuggestedPeriod") &&
95                 odr_implicit_tag (o, odr_generalizedtime,
96                         &(*p)->expiration, ODR_CONTEXT, 3, 1, "expiration") &&
97                 odr_implicit_tag (o, z_InternationalString,
98                         &(*p)->resultSetPackage, ODR_CONTEXT, 4, 1, "resultSetPackage") &&
99                 odr_sequence_end (o);
100 }
101
102 int z_PQSTargetPart (ODR o, Z_PQSTargetPart **p, int opt, const char *name)
103 {
104         if (!odr_sequence_begin (o, p, sizeof(**p), name))
105                 return odr_missing(o, opt, name) && odr_ok (o);
106         return
107                 odr_explicit_tag (o, z_Query,
108                         &(*p)->actualQuery, ODR_CONTEXT, 1, 0, "actualQuery") &&
109                 odr_explicit_tag (o, z_PQSPeriod,
110                         &(*p)->targetStatedPeriod, ODR_CONTEXT, 2, 0, "targetStatedPeriod") &&
111                 odr_implicit_tag (o, odr_generalizedtime,
112                         &(*p)->expiration, ODR_CONTEXT, 3, 1, "expiration") &&
113                 odr_implicit_tag (o, z_InternationalString,
114                         &(*p)->resultSetPackage, ODR_CONTEXT, 4, 1, "resultSetPackage") &&
115                 odr_implicit_tag (o, odr_generalizedtime,
116                         &(*p)->lastQueryTime, ODR_CONTEXT, 5, 0, "lastQueryTime") &&
117                 odr_implicit_tag (o, odr_integer,
118                         &(*p)->lastResultNumber, ODR_CONTEXT, 6, 0, "lastResultNumber") &&
119                 odr_implicit_tag (o, odr_integer,
120                         &(*p)->numberSinceModify, ODR_CONTEXT, 7, 1, "numberSinceModify") &&
121                 odr_sequence_end (o);
122 }
123
124 int z_PQSPeriod (ODR o, Z_PQSPeriod **p, int opt, const char *name)
125 {
126         static Odr_arm arm[] = {
127                 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PQSPeriod_unit,
128                 (Odr_fun) z_IntUnit, "unit"},
129                 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PQSPeriod_businessDaily,
130                 (Odr_fun) odr_null, "businessDaily"},
131                 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_PQSPeriod_continuous,
132                 (Odr_fun) odr_null, "continuous"},
133                 {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_PQSPeriod_other,
134                 (Odr_fun) z_InternationalString, "other"},
135                 {-1, -1, -1, -1, (Odr_fun) 0, 0}
136         };
137         if (!odr_initmember(o, p, sizeof(**p)))
138                 return odr_missing(o, opt, name);
139         if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
140                 return 1;
141         if(o->direction == ODR_DECODE)
142                 *p = 0;
143         return odr_missing(o, opt, name);
144 }