YAZ  5.23.1
zes-expi.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-expi.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, 1, "targetPart") &&
34 }
35 
36 int z_EIExportInvocation(ODR o, Z_EIExportInvocation **p, int opt, const char *name)
37 {
38  static Odr_arm arm[] = {
40  (Odr_fun) z_EIExportInvocationEsRequest, "esRequest"},
42  (Odr_fun) z_EIExportInvocationTaskPackage, "taskPackage"},
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 
54 int z_EIOriginPartToKeep(ODR o, Z_EIOriginPartToKeep **p, int opt, const char *name)
55 {
56  static Odr_arm arm[] = {
58  (Odr_fun) z_InternationalString, "packageName"},
60  (Odr_fun) z_ESExportSpecification, "packageSpec"},
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
66  odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 1, "exportSpec") &&
67  odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
70  &(*p)->numberOfCopies, ODR_CONTEXT, 2, 0, "numberOfCopies") &&
72 }
73 
75 {
76  if (!odr_sequence_begin(o, p, sizeof(**p), name))
77  return odr_missing(o, opt, name) && odr_ok (o);
78  return
80  &(*p)->start, ODR_CONTEXT, 1, 0, "start") &&
82  &(*p)->count, ODR_CONTEXT, 2, 1, "count") &&
84 }
85 
87 {
88  if (!odr_initmember(o, p, sizeof(**p)))
89  return odr_missing(o, opt, name);
91  &(*p)->num, name))
92  return 1;
93  if (o->direction == ODR_DECODE)
94  *p = 0;
95  return odr_missing(o, opt, name);
96 }
97 
99 {
100  static Odr_arm arm[] = {
102  (Odr_fun) odr_null, "all"},
105  {-1, -1, -1, -1, (Odr_fun) 0, 0}
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)->resultSetId, ODR_CONTEXT, 1, 0, "resultSetId") &&
112  odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 2, "records") &&
113  odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
114  odr_constructed_end(o) &&
115  odr_sequence_end(o);
116 }
117 
118 int z_EITargetPart(ODR o, Z_EITargetPart **p, int opt, const char *name)
119 {
120  if (!odr_sequence_begin(o, p, sizeof(**p), name))
121  return odr_missing(o, opt, name) && odr_ok (o);
122  return
124  &(*p)->estimatedQuantity, ODR_CONTEXT, 1, 1, "estimatedQuantity") &&
126  &(*p)->quantitySoFar, ODR_CONTEXT, 2, 1, "quantitySoFar") &&
128  &(*p)->estimatedCost, ODR_CONTEXT, 3, 1, "estimatedCost") &&
130  &(*p)->costSoFar, ODR_CONTEXT, 4, 1, "costSoFar") &&
131  odr_sequence_end(o);
132 }
#define odr_ok(o)
Definition: odr.h:215
#define Z_EIOriginPartToKeep_packageName
Definition: zes-expi.h:71
int z_EIOriginPartNotToKeep(ODR o, Z_EIOriginPartNotToKeep **p, int opt, const char *name)
Definition: zes-expi.c:98
int z_ESExportSpecification(ODR o, Z_ESExportSpecification **p, int opt, const char *name)
Definition: zes-exps.c:36
#define Z_EIExportInvocation_esRequest
Definition: zes-expi.h:61
#define odr_explicit_tag(o, t, p, cl, tg, opt, name)
Definition: odr.h:195
int z_EIExportInvocationEsRequest(ODR o, Z_EIExportInvocationEsRequest **p, int opt, const char *name)
Definition: zes-expi.c:12
#define Z_EIExportInvocation_taskPackage
Definition: zes-expi.h:62
#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
int z_EITargetPart(ODR o, Z_EITargetPart **p, int opt, const char *name)
Definition: zes-expi.c:118
char * name
Definition: initopt.c:18
int odr_constructed_begin(ODR o, void *xxp, int zclass, int tag, const char *name)
Definition: odr_cons.c:24
#define Z_EIOriginPartNotToKeep_ranges
Definition: zes-expi.h:94
int odr_initmember(ODR o, void *p, int size)
Definition: odr_tag.c:44
int direction
Definition: odr.h:126
int odr_integer(ODR o, Odr_int **p, int opt, const char *name)
Definition: odr_int.c:19
int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, const char *name)
Definition: odr_choice.c:17
#define ODR_EXPLICIT
Definition: odr.h:60
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_EIOriginPartNotToKeepRanges_s(ODR o, Z_EIOriginPartNotToKeepRanges_s **p, int opt, const char *name)
Definition: zes-expi.c:74
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_EIExportInvocation(ODR o, Z_EIExportInvocation **p, int opt, const char *name)
Definition: zes-expi.c:36
int odr_missing(ODR o, int opt, const char *name)
Definition: odr_util.c:82
int z_EIOriginPartToKeep(ODR o, Z_EIOriginPartToKeep **p, int opt, const char *name)
Definition: zes-expi.c:54
Definition: odr.h:124
int odr_sequence_end(ODR o)
Definition: odr_seq.c:61
int opt
Definition: initopt.c:19
ASN.1 Module ESFormat-ExportInvocation.
#define ODR_IMPLICIT
Definition: odr.h:59
#define Z_EIOriginPartToKeep_packageSpec
Definition: zes-expi.h:72
int z_EIOriginPartNotToKeepRanges(ODR o, Z_EIOriginPartNotToKeepRanges **p, int opt, const char *name)
Definition: zes-expi.c:86
int z_InternationalString(ODR o, Z_InternationalString **p, int opt, const char *name)
Definition: z-core.c:1598
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
int z_EIExportInvocationTaskPackage(ODR o, Z_EIExportInvocationTaskPackage **p, int opt, const char *name)
Definition: zes-expi.c:24
#define ODR_DECODE
Definition: odr.h:95
#define Z_EIOriginPartNotToKeep_all
Definition: zes-expi.h:93