YAZ  5.23.1
zes-exps.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-exps.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 
54 int z_ESOriginPartToKeep(ODR o, Z_ESOriginPartToKeep **p, int opt, const char *name)
55 {
56  if (!odr_sequence_begin(o, p, sizeof(**p), name))
57  return odr_missing(o, opt, name) && odr_ok (o);
58  return
60  &(*p)->composition, ODR_CONTEXT, 1, 0, "composition") &&
62  &(*p)->exportDestination, ODR_CONTEXT, 2, 0, "exportDestination") &&
64 }
65 
66 int z_ESDestinationOther(ODR o, Z_ESDestinationOther **p, int opt, const char *name)
67 {
68  if (!odr_sequence_begin(o, p, sizeof(**p), name))
69  return odr_missing(o, opt, name) && odr_ok (o);
70  return
72  &(*p)->vehicle, ODR_CONTEXT, 1, 1, "vehicle") &&
74  &(*p)->destination, ODR_CONTEXT, 2, 0, "destination") &&
76 }
77 
78 int z_ESDestination(ODR o, Z_ESDestination **p, int opt, const char *name)
79 {
80  static Odr_arm arm[] = {
82  (Odr_fun) z_InternationalString, "phoneNumber"},
84  (Odr_fun) z_InternationalString, "faxNumber"},
86  (Odr_fun) z_InternationalString, "x400address"},
88  (Odr_fun) z_InternationalString, "emailAddress"},
90  (Odr_fun) z_InternationalString, "pagerNumber"},
92  (Odr_fun) z_InternationalString, "ftpAddress"},
94  (Odr_fun) z_InternationalString, "ftamAddress"},
96  (Odr_fun) z_InternationalString, "printerAddress"},
98  (Odr_fun) z_ESDestinationOther, "other"},
99  {-1, -1, -1, -1, (Odr_fun) 0, 0}
100  };
101  if (!odr_initmember(o, p, sizeof(**p)))
102  return odr_missing(o, opt, name);
103  if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
104  return 1;
105  if (o->direction == ODR_DECODE)
106  *p = 0;
107  return odr_missing(o, opt, name);
108 }
#define odr_ok(o)
Definition: odr.h:215
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 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
#define Z_ESDestination_faxNumber
Definition: zes-exps.h:82
char * name
Definition: initopt.c:18
int z_CompSpec(ODR o, Z_CompSpec **p, int opt, const char *name)
Definition: z-core.c:742
int odr_initmember(ODR o, void *p, int size)
Definition: odr_tag.c:44
int direction
Definition: odr.h:126
int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, const char *name)
Definition: odr_choice.c:17
#define Z_ESDestination_phoneNumber
Definition: zes-exps.h:81
ASN.1 Module ESFormat-ExportSpecification.
#define Z_ESDestination_ftamAddress
Definition: zes-exps.h:87
#define Z_ESExportSpecification_esRequest
Definition: zes-exps.h:54
int z_ESDestinationOther(ODR o, Z_ESDestinationOther **p, int opt, const char *name)
Definition: zes-exps.c:66
int(* Odr_fun)(ODR, char **, int, const char *)
Definition: odr.h:135
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
#define Z_ESDestination_emailAddress
Definition: zes-exps.h:84
int odr_null(ODR o, Odr_null **p, int opt, const char *name)
Definition: odr_null.c:19
int odr_missing(ODR o, int opt, const char *name)
Definition: odr_util.c:82
#define Z_ESDestination_other
Definition: zes-exps.h:89
Definition: odr.h:124
int odr_sequence_end(ODR o)
Definition: odr_seq.c:61
#define Z_ESDestination_printerAddress
Definition: zes-exps.h:88
int opt
Definition: initopt.c:19
#define Z_ESExportSpecification_taskPackage
Definition: zes-exps.h:55
int z_ESExportSpecificationTaskPackage(ODR o, Z_ESExportSpecificationTaskPackage **p, int opt, const char *name)
Definition: zes-exps.c:24
#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
int z_ESOriginPartToKeep(ODR o, Z_ESOriginPartToKeep **p, int opt, const char *name)
Definition: zes-exps.c:54
#define Z_ESDestination_pagerNumber
Definition: zes-exps.h:85
#define Z_ESDestination_x400address
Definition: zes-exps.h:83
int z_ESExportSpecificationEsRequest(ODR o, Z_ESExportSpecificationEsRequest **p, int opt, const char *name)
Definition: zes-exps.c:12
#define ODR_CONTEXT
Definition: odr.h:67
#define Z_ESDestination_ftpAddress
Definition: zes-exps.h:86
#define ODR_DECODE
Definition: odr.h:95