YAZ  5.23.1
zes-pquery.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-pquery.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, 1, "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, 1, "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  if (!odr_sequence_begin(o, p, sizeof(**p), name))
57  return odr_missing(o, opt, name) && odr_ok (o);
58  return
60  (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->dbNames,
61  &(*p)->num_dbNames, "dbNames") || odr_ok(o)) &&
63  &(*p)->additionalSearchInfo, ODR_CONTEXT, 3, 1, "additionalSearchInfo") &&
65 }
66 
68 {
69  static Odr_arm arm[] = {
71  (Odr_fun) z_InternationalString, "package"},
73  (Odr_fun) z_Query, "query"},
74  {-1, -1, -1, -1, (Odr_fun) 0, 0}
75  };
76  if (!odr_initmember(o, p, sizeof(**p)))
77  return odr_missing(o, opt, name);
78  if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
79  return 1;
80  if (o->direction == ODR_DECODE)
81  *p = 0;
82  return odr_missing(o, opt, name);
83 }
84 
85 int z_PQueryTargetPart(ODR o, Z_PQueryTargetPart **p, int opt, const char *name)
86 {
87  return z_Query (o, p, opt, name);
88 }
#define odr_ok(o)
Definition: odr.h:215
#define odr_explicit_tag(o, t, p, cl, tg, opt, name)
Definition: odr.h:195
int z_PQueryPersistentQueryTaskPackage(ODR o, Z_PQueryPersistentQueryTaskPackage **p, int opt, const char *name)
Definition: zes-pquery.c:24
int z_PQueryPersistentQuery(ODR o, Z_PQueryPersistentQuery **p, int opt, const char *name)
Definition: zes-pquery.c:36
int z_PQueryOriginPartToKeep(ODR o, Z_PQueryOriginPartToKeep **p, int opt, const char *name)
Definition: zes-pquery.c:54
int z_PQueryOriginPartNotToKeep(ODR o, Z_PQueryOriginPartNotToKeep **p, int opt, const char *name)
Definition: zes-pquery.c:67
int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt, const char *name)
Definition: z-core.c:1545
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_PQueryPersistentQuery_taskPackage
Definition: zes-pquery.h:55
int odr_initmember(ODR o, void *p, int size)
Definition: odr_tag.c:44
#define Z_PQueryPersistentQuery_esRequest
Definition: zes-pquery.h:54
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_PQueryOriginPartNotToKeep_query
Definition: zes-pquery.h:71
#define Z_PQueryOriginPartNotToKeep_package
Definition: zes-pquery.h:70
#define ODR_EXPLICIT
Definition: odr.h:60
int z_PQueryTargetPart(ODR o, Z_PQueryTargetPart **p, int opt, const char *name)
Definition: zes-pquery.c:85
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_Query(ODR o, Z_Query **p, int opt, const char *name)
Definition: z-core.c:207
int which
Definition: odr.h:142
Definition: odr.h:137
int odr_missing(ODR o, int opt, const char *name)
Definition: odr_util.c:82
Definition: odr.h:124
int odr_sequence_end(ODR o)
Definition: odr_seq.c:61
int z_PQueryPersistentQueryEsRequest(ODR o, Z_PQueryPersistentQueryEsRequest **p, int opt, const char *name)
Definition: zes-pquery.c:12
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 ODR_CONTEXT
Definition: odr.h:67
ASN.1 Module ESFormat-PersistentQuery.
#define ODR_DECODE
Definition: odr.h:95
int odr_implicit_settag(ODR o, int zclass, int tag)
Definition: odr_tag.c:32