2 * Copyright (c) 1995-1998, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.3 1998-01-05 09:04:57 adam
8 * Fixed bugs in encoders/decoders - Not operator (!) missing.
10 * Revision 1.2 1997/04/30 08:52:02 quinn
13 * Revision 1.1 1996/10/10 11:52:18 quinn
14 * Added SearchResult additionalInfo
21 int z_ResultsByDBList (ODR o, Z_ResultsByDBList **p, int opt)
23 if (!odr_initmember (o, p, sizeof(**p)))
24 return opt && odr_ok(o);
25 if (odr_sequence_of (o, z_DatabaseName, &(*p)->elements,
29 return opt && odr_ok(o);
32 int z_ResultsByDB_elem (ODR o, Z_ResultsByDB_elem **p, int opt)
34 static Odr_arm arm[] = {
35 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ResultsByDB_all, odr_null},
36 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ResultsByDB_list, z_ResultsByDBList},
39 if (!odr_sequence_begin (o, p, sizeof(**p)))
40 return opt && odr_ok (o);
42 odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1) &&
43 odr_choice (o, arm, &(*p)->u, &(*p)->which) &&
44 odr_constructed_end (o) &&
45 odr_implicit (o, odr_integer,
46 &(*p)->count, ODR_CONTEXT, 2, 1) &&
47 odr_implicit (o, z_InternationalString,
48 &(*p)->resultSetName, ODR_CONTEXT, 3, 1) &&
52 int z_ResultsByDB (ODR o, Z_ResultsByDB **p, int opt)
54 if (!odr_initmember (o, p, sizeof(**p)))
55 return opt && odr_ok(o);
56 if (odr_sequence_of (o, z_ResultsByDB_elem, &(*p)->elements,
60 return opt && odr_ok(o);
63 int z_QueryExpressionTerm (ODR o, Z_QueryExpressionTerm **p, int opt)
65 if (!odr_sequence_begin (o, p, sizeof(**p)))
66 return opt && odr_ok (o);
68 odr_explicit (o, z_Term,
69 &(*p)->queryTerm, ODR_CONTEXT, 1, 0) &&
70 odr_implicit (o, z_InternationalString,
71 &(*p)->termComment, ODR_CONTEXT, 2, 1) &&
75 int z_QueryExpression (ODR o, Z_QueryExpression **p, int opt)
77 static Odr_arm arm[] = {
78 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_QueryExpression_term,
79 z_QueryExpressionTerm},
80 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_QueryExpression_query, z_Query},
83 if (!odr_initmember(o, p, sizeof(**p)))
84 return opt && odr_ok(o);
85 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
88 return opt && odr_ok(o);
91 int z_SearchInfoReport_elem (ODR o, Z_SearchInfoReport_elem **p, int opt)
93 if (!odr_sequence_begin (o, p, sizeof(**p)))
94 return opt && odr_ok (o);
96 odr_implicit (o, z_InternationalString,
97 &(*p)->subqueryId, ODR_CONTEXT, 1, 1) &&
98 odr_implicit (o, odr_bool,
99 &(*p)->fullQuery, ODR_CONTEXT, 2, 0) &&
100 odr_explicit (o, z_QueryExpression,
101 &(*p)->subqueryExpression, ODR_CONTEXT, 3, 1) &&
102 odr_explicit (o, z_QueryExpression,
103 &(*p)->subqueryInterpretation, ODR_CONTEXT, 4, 1) &&
104 odr_explicit (o, z_QueryExpression,
105 &(*p)->subqueryRecommendation, ODR_CONTEXT, 5, 1) &&
106 odr_implicit (o, odr_integer,
107 &(*p)->subqueryCount, ODR_CONTEXT, 6, 1) &&
108 odr_implicit (o, z_IntUnit,
109 &(*p)->subqueryWeight, ODR_CONTEXT, 7, 1) &&
110 odr_implicit (o, z_ResultsByDB,
111 &(*p)->resultsByDB, ODR_CONTEXT, 8, 1) &&
112 odr_sequence_end (o);
115 int z_SearchInfoReport (ODR o, Z_SearchInfoReport **p, int opt)
117 if (!odr_initmember (o, p, sizeof(**p)))
118 return opt && odr_ok(o);
119 if (odr_sequence_of (o, z_SearchInfoReport_elem, &(*p)->elements,
123 return opt && odr_ok(o);