YAZ  5.23.1
zes-update0.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-update0.h>
11 
12 int z_IU0UpdateEsRequest(ODR o, Z_IU0UpdateEsRequest **p, int opt, const char *name)
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 
36 int z_IU0Update(ODR o, Z_IU0Update **p, int opt, const char *name)
37 {
38  static Odr_arm arm[] = {
40  (Odr_fun) z_IU0UpdateEsRequest, "esRequest"},
42  (Odr_fun) z_IU0UpdateTaskPackage, "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 
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)->action, ODR_CONTEXT, 1, 0, "action") &&
62  &(*p)->databaseName, ODR_CONTEXT, 2, 0, "databaseName") &&
64  &(*p)->schema, ODR_CONTEXT, 3, 1, "schema") &&
66  &(*p)->elementSetName, ODR_CONTEXT, 4, 1, "elementSetName") &&
68 }
69 
71 {
72  return z_IU0SuppliedRecords (o, p, opt, name);
73 }
74 
75 int z_IU0TargetPart(ODR o, Z_IU0TargetPart **p, int opt, const char *name)
76 {
77  if (!odr_sequence_begin(o, p, sizeof(**p), name))
78  return odr_missing(o, opt, name) && odr_ok (o);
79  return
81  &(*p)->updateStatus, ODR_CONTEXT, 1, 0, "updateStatus") &&
83  (odr_sequence_of(o, (Odr_fun) z_DiagRec, &(*p)->globalDiagnostics,
84  &(*p)->num_globalDiagnostics, "globalDiagnostics") || odr_ok(o)) &&
86  (odr_sequence_of(o, (Odr_fun) z_IU0TaskPackageRecordStructure, &(*p)->taskPackageRecords,
87  &(*p)->num_taskPackageRecords, "taskPackageRecords") || odr_ok(o)) &&
89 }
90 
92 {
93  static Odr_arm arm[] = {
95  (Odr_fun) odr_generalizedtime, "timeStamp"},
97  (Odr_fun) z_InternationalString, "versionNumber"},
99  (Odr_fun) z_External, "previousVersion"},
100  {-1, -1, -1, -1, (Odr_fun) 0, 0}
101  };
102  if (!odr_initmember(o, p, sizeof(**p)))
103  return odr_missing(o, opt, name);
104  if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
105  return 1;
106  if (o->direction == ODR_DECODE)
107  *p = 0;
108  return odr_missing(o, opt, name);
109 }
110 
112 {
113  static Odr_arm arm[] = {
115  (Odr_fun) odr_integer, "number"},
117  (Odr_fun) z_InternationalString, "string"},
119  (Odr_fun) odr_octetstring, "opaque"},
120  {-1, -1, -1, -1, (Odr_fun) 0, 0}
121  };
122  if (!odr_sequence_begin(o, p, sizeof(**p), name))
123  return odr_missing(o, opt, name) && odr_ok (o);
124  return
125  ((odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 1, "recordId") &&
126  odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
127  odr_constructed_end(o)) || odr_ok(o)) &&
129  &(*p)->supplementalId, ODR_CONTEXT, 2, 1, "supplementalId") &&
131  &(*p)->correlationInfo, ODR_CONTEXT, 3, 1, "correlationInfo") &&
133  &(*p)->record, ODR_CONTEXT, 4, 0, "record") &&
134  odr_sequence_end(o);
135 }
136 
137 int z_IU0SuppliedRecords(ODR o, Z_IU0SuppliedRecords **p, int opt, const char *name)
138 {
139  if (!odr_initmember(o, p, sizeof(**p)))
140  return odr_missing(o, opt, name);
141  if (odr_sequence_of(o, (Odr_fun) z_IU0SuppliedRecords_elem, &(*p)->elements,
142  &(*p)->num, name))
143  return 1;
144  if (o->direction == ODR_DECODE)
145  *p = 0;
146  return odr_missing(o, opt, name);
147 }
148 
149 int z_IU0CorrelationInfo(ODR o, Z_IU0CorrelationInfo **p, int opt, const char *name)
150 {
151  if (!odr_sequence_begin(o, p, sizeof(**p), name))
152  return odr_missing(o, opt, name) && odr_ok (o);
153  return
155  &(*p)->note, ODR_CONTEXT, 1, 1, "note") &&
157  &(*p)->id, ODR_CONTEXT, 2, 1, "id") &&
158  odr_sequence_end(o);
159 }
160 
162 {
163  static Odr_arm arm[] = {
165  (Odr_fun) z_External, "record"},
167  (Odr_fun) z_DiagRec, "diagnostic"},
168  {-1, -1, -1, -1, (Odr_fun) 0, 0}
169  };
170  if (!odr_sequence_begin(o, p, sizeof(**p), name))
171  return odr_missing(o, opt, name) && odr_ok (o);
172  return
173  ((odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 1, "recordOrSurDiag") &&
174  odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
175  odr_constructed_end(o)) || odr_ok(o)) &&
177  &(*p)->correlationInfo, ODR_CONTEXT, 2, 1, "correlationInfo") &&
179  &(*p)->recordStatus, ODR_CONTEXT, 3, 0, "recordStatus") &&
180  odr_sequence_end(o);
181 }
#define odr_ok(o)
Definition: odr.h:215
#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
char * name
Definition: initopt.c:18
#define Z_IU0Update_taskPackage
Definition: zes-update0.h:70
ASN.1 Module ESFormat-Update0.
int z_External(ODR o, Z_External **p, int opt, const char *name)
codec for BER EXTERNAL
Definition: prt-ext.c:95
int odr_constructed_begin(ODR o, void *xxp, int zclass, int tag, const char *name)
Definition: odr_cons.c:24
#define Z_IU0Update_esRequest
Definition: zes-update0.h:69
int odr_initmember(ODR o, void *p, int size)
Definition: odr_tag.c:44
int z_IU0TargetPart(ODR o, Z_IU0TargetPart **p, int opt, const char *name)
Definition: zes-update0.c:75
#define Z_IU0SuppliedRecords_elem_number
Definition: zes-update0.h:116
int direction
Definition: odr.h:126
int odr_integer(ODR o, Odr_int **p, int opt, const char *name)
Definition: odr_int.c:19
#define Z_IU0SuppliedRecordsId_versionNumber
Definition: zes-update0.h:105
int z_IU0SuppliedRecords_elem(ODR o, Z_IU0SuppliedRecords_elem **p, int opt, const char *name)
Definition: zes-update0.c:111
int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, const char *name)
Definition: odr_choice.c:17
#define Z_IU0TaskPackageRecordStructure_diagnostic
Definition: zes-update0.h:141
#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_IU0SuppliedRecords(ODR o, Z_IU0SuppliedRecords **p, int opt, const char *name)
Definition: zes-update0.c:137
int which
Definition: odr.h:142
Definition: odr.h:137
#define Z_IU0SuppliedRecordsId_timeStamp
Definition: zes-update0.h:104
int z_IU0OriginPartToKeep(ODR o, Z_IU0OriginPartToKeep **p, int opt, const char *name)
Definition: zes-update0.c:54
int z_DiagRec(ODR o, Z_DiagRec **p, int opt, const char *name)
Definition: z-core.c:637
int odr_missing(ODR o, int opt, const char *name)
Definition: odr_util.c:82
Definition: odr.h:124
#define Z_IU0TaskPackageRecordStructure_record
Definition: zes-update0.h:140
#define Z_IU0SuppliedRecords_elem_string
Definition: zes-update0.h:117
int odr_sequence_end(ODR o)
Definition: odr_seq.c:61
int opt
Definition: initopt.c:19
int z_IU0TaskPackageRecordStructure(ODR o, Z_IU0TaskPackageRecordStructure **p, int opt, const char *name)
Definition: zes-update0.c:161
#define ODR_IMPLICIT
Definition: odr.h:59
int odr_oid(ODR o, Odr_oid **p, int opt, const char *name)
Definition: odr_oid.c:20
int z_InternationalString(ODR o, Z_InternationalString **p, int opt, const char *name)
Definition: z-core.c:1598
int z_IU0OriginPartNotToKeep(ODR o, Z_IU0OriginPartNotToKeep **p, int opt, const char *name)
Definition: zes-update0.c:70
int odr_octetstring(ODR o, Odr_oct **p, int opt, const char *name)
Definition: odr_oct.c:19
int z_IU0Update(ODR o, Z_IU0Update **p, int opt, const char *name)
Definition: zes-update0.c:36
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
int z_IU0UpdateTaskPackage(ODR o, Z_IU0UpdateTaskPackage **p, int opt, const char *name)
Definition: zes-update0.c:24
#define ODR_CONTEXT
Definition: odr.h:67
#define Z_IU0SuppliedRecords_elem_opaque
Definition: zes-update0.h:118
int z_IU0CorrelationInfo(ODR o, Z_IU0CorrelationInfo **p, int opt, const char *name)
Definition: zes-update0.c:149
int z_IU0UpdateEsRequest(ODR o, Z_IU0UpdateEsRequest **p, int opt, const char *name)
Definition: zes-update0.c:12
int z_IU0SuppliedRecordsId(ODR o, Z_IU0SuppliedRecordsId **p, int opt, const char *name)
Definition: zes-update0.c:91
#define ODR_DECODE
Definition: odr.h:95
#define Z_IU0SuppliedRecordsId_previousVersion
Definition: zes-update0.h:106
int odr_implicit_settag(ODR o, int zclass, int tag)
Definition: odr_tag.c:32