YAZ  5.23.1
zes-psched.c
Go to the documentation of this file.
1 
6 #if HAVE_CONFIG_H
7 #include <config.h>
8 #endif
9 
10 #include <yaz/zes-psched.h>
11 
13 {
14  if (!odr_sequence_begin(o, p, sizeof(**p), name))
15  return odr_missing(o, opt, name) && odr_ok (o);
16  return
18  &(*p)->toKeep, ODR_CONTEXT, 1, 0, "toKeep") &&
20  &(*p)->notToKeep, ODR_CONTEXT, 2, 0, "notToKeep") &&
22 }
23 
25 {
26  if (!odr_sequence_begin(o, p, sizeof(**p), name))
27  return odr_missing(o, opt, name) && odr_ok (o);
28  return
30  &(*p)->originPart, ODR_CONTEXT, 1, 0, "originPart") &&
32  &(*p)->targetPart, ODR_CONTEXT, 2, 0, "targetPart") &&
34 }
35 
37 {
38  static Odr_arm arm[] = {
43  {-1, -1, -1, -1, (Odr_fun) 0, 0}
44  };
45  if (!odr_initmember(o, p, sizeof(**p)))
46  return odr_missing(o, opt, name);
47  if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
48  return 1;
49  if (o->direction == ODR_DECODE)
50  *p = 0;
51  return odr_missing(o, opt, name);
52 }
53 
55 {
56  static Odr_arm arm[] = {
58  (Odr_fun) z_InternationalString, "packageName"},
60  (Odr_fun) z_ESExportSpecification, "exportPackage"},
61  {-1, -1, -1, -1, (Odr_fun) 0, 0}
62  };
63  if (!odr_sequence_begin(o, p, sizeof(**p), name))
64  return odr_missing(o, opt, name) && odr_ok (o);
65  return
67  &(*p)->activeFlag, ODR_CONTEXT, 1, 0, "activeFlag") &&
69  (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->databaseNames,
70  &(*p)->num_databaseNames, "databaseNames") || odr_ok(o)) &&
72  &(*p)->resultSetDisposition, ODR_CONTEXT, 3, 1, "resultSetDisposition") &&
74  &(*p)->alertDestination, ODR_CONTEXT, 4, 1, "alertDestination") &&
75  ((odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 5, "exportParameters") &&
76  odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
77  odr_constructed_end(o)) || odr_ok(o)) &&
79 }
80 
82 {
83  static Odr_arm arm[] = {
85  (Odr_fun) z_Query, "actualQuery"},
87  (Odr_fun) z_InternationalString, "packageName"},
88  {-1, -1, -1, -1, (Odr_fun) 0, 0}
89  };
90  if (!odr_sequence_begin(o, p, sizeof(**p), name))
91  return odr_missing(o, opt, name) && odr_ok (o);
92  return
93  ((odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 1, "querySpec") &&
94  odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
95  odr_constructed_end(o)) || odr_ok(o)) &&
97  &(*p)->originSuggestedPeriod, ODR_CONTEXT, 2, 1, "originSuggestedPeriod") &&
99  &(*p)->expiration, ODR_CONTEXT, 3, 1, "expiration") &&
101  &(*p)->resultSetPackage, ODR_CONTEXT, 4, 1, "resultSetPackage") &&
102  odr_sequence_end(o);
103 }
104 
105 int z_PQSTargetPart(ODR o, Z_PQSTargetPart **p, int opt, const char *name)
106 {
107  if (!odr_sequence_begin(o, p, sizeof(**p), name))
108  return odr_missing(o, opt, name) && odr_ok (o);
109  return
111  &(*p)->actualQuery, ODR_CONTEXT, 1, 0, "actualQuery") &&
113  &(*p)->targetStatedPeriod, ODR_CONTEXT, 2, 0, "targetStatedPeriod") &&
115  &(*p)->expiration, ODR_CONTEXT, 3, 1, "expiration") &&
117  &(*p)->resultSetPackage, ODR_CONTEXT, 4, 1, "resultSetPackage") &&
119  &(*p)->lastQueryTime, ODR_CONTEXT, 5, 0, "lastQueryTime") &&
121  &(*p)->lastResultNumber, ODR_CONTEXT, 6, 0, "lastResultNumber") &&
123  &(*p)->numberSinceModify, ODR_CONTEXT, 7, 1, "numberSinceModify") &&
124  odr_sequence_end(o);
125 }
126 
127 int z_PQSPeriod(ODR o, Z_PQSPeriod **p, int opt, const char *name)
128 {
129  static Odr_arm arm[] = {
131  (Odr_fun) z_IntUnit, "unit"},
133  (Odr_fun) odr_null, "businessDaily"},
135  (Odr_fun) odr_null, "continuous"},
137  (Odr_fun) z_InternationalString, "other"},
138  {-1, -1, -1, -1, (Odr_fun) 0, 0}
139  };
140  if (!odr_initmember(o, p, sizeof(**p)))
141  return odr_missing(o, opt, name);
142  if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
143  return 1;
144  if (o->direction == ODR_DECODE)
145  *p = 0;
146  return odr_missing(o, opt, name);
147 }
#define odr_ok(o)
Definition: odr.h:215
int z_PQSPeriodicQueryScheduleTaskPackage(ODR o, Z_PQSPeriodicQueryScheduleTaskPackage **p, int opt, const char *name)
Definition: zes-psched.c:24
int z_ESExportSpecification(ODR o, Z_ESExportSpecification **p, int opt, const char *name)
Definition: zes-exps.c:36
#define odr_explicit_tag(o, t, p, cl, tg, opt, name)
Definition: odr.h:195
#define Z_PQSOriginPartToKeep_packageName
Definition: zes-psched.h:76
#define Z_PQSPeriodicQuerySchedule_esRequest
Definition: zes-psched.h:58
#define odr_implicit_tag(o, t, p, cl, tg, opt, name)
Definition: odr.h:192
int odr_sequence_begin(ODR o, void *p, int size, const char *name)
Definition: odr_seq.c:15
char * name
Definition: initopt.c:18
#define Z_PQSPeriodicQuerySchedule_taskPackage
Definition: zes-psched.h:59
int odr_constructed_begin(ODR o, void *xxp, int zclass, int tag, const char *name)
Definition: odr_cons.c:24
int odr_initmember(ODR o, void *p, int size)
Definition: odr_tag.c:44
int direction
Definition: odr.h:126
int z_PQSOriginPartNotToKeep(ODR o, Z_PQSOriginPartNotToKeep **p, int opt, const char *name)
Definition: zes-psched.c:81
int odr_integer(ODR o, Odr_int **p, int opt, const char *name)
Definition: odr_int.c:19
int odr_bool(ODR o, Odr_bool **p, int opt, const char *name)
Definition: odr_bool.c:21
int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, const char *name)
Definition: odr_choice.c:17
int z_PQSOriginPartToKeep(ODR o, Z_PQSOriginPartToKeep **p, int opt, const char *name)
Definition: zes-psched.c:54
#define Z_PQSPeriod_continuous
Definition: zes-psched.h:113
#define ODR_EXPLICIT
Definition: odr.h:60
#define Z_PQSPeriod_unit
Definition: zes-psched.h:111
int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num, const char *name)
Definition: odr_seq.c:134
int(* Odr_fun)(ODR, char **, int, const char *)
Definition: odr.h:135
int z_PQSTargetPart(ODR o, Z_PQSTargetPart **p, int opt, const char *name)
Definition: zes-psched.c:105
int z_Query(ODR o, Z_Query **p, int opt, const char *name)
Definition: z-core.c:207
int z_ESDestination(ODR o, Z_ESDestination **p, int opt, const char *name)
Definition: zes-exps.c:78
int which
Definition: odr.h:142
Definition: odr.h:137
int odr_null(ODR o, Odr_null **p, int opt, const char *name)
Definition: odr_null.c:19
int z_PQSPeriodicQuerySchedule(ODR o, Z_PQSPeriodicQuerySchedule **p, int opt, const char *name)
Definition: zes-psched.c:36
int odr_missing(ODR o, int opt, const char *name)
Definition: odr_util.c:82
int z_PQSPeriodicQueryScheduleEsRequest(ODR o, Z_PQSPeriodicQueryScheduleEsRequest **p, int opt, const char *name)
Definition: zes-psched.c:12
#define Z_PQSPeriod_businessDaily
Definition: zes-psched.h:112
Definition: odr.h:124
int odr_sequence_end(ODR o)
Definition: odr_seq.c:61
int opt
Definition: initopt.c:19
#define ODR_IMPLICIT
Definition: odr.h:59
int z_InternationalString(ODR o, Z_InternationalString **p, int opt, const char *name)
Definition: z-core.c:1598
#define Z_PQSOriginPartToKeep_exportPackage
Definition: zes-psched.h:77
#define Z_PQSOriginPartNotToKeep_actualQuery
Definition: zes-psched.h:86
int z_PQSPeriod(ODR o, Z_PQSPeriod **p, int opt, const char *name)
Definition: zes-psched.c:127
#define Z_PQSOriginPartNotToKeep_packageName
Definition: zes-psched.h:87
int odr_generalizedtime(ODR o, char **p, int opt, const char *name)
Definition: odr_use.c:63
int odr_constructed_end(ODR o)
Definition: odr_cons.c:148
#define ODR_CONTEXT
Definition: odr.h:67
int z_IntUnit(ODR o, Z_IntUnit **p, int opt, const char *name)
Definition: z-core.c:1570
ASN.1 Module ESFormat-PeriodicQuerySchedule.
#define Z_PQSPeriod_other
Definition: zes-psched.h:114
#define ODR_DECODE
Definition: odr.h:95
int odr_implicit_settag(ODR o, int zclass, int tag)
Definition: odr_tag.c:32