root/trunk/gsdl/packages/yaz/z39.50/zes-order.c @ 1343

Revision 1343, 5.4 KB (checked in by johnmcp, 20 years ago)

Added the YAZ toolkit source to the packages directory (for z39.50 stuff)

  • Property svn:keywords set to Author Date Id Revision
Line 
1/* Generated automatically by the YAZ ASN.1 Compiler 0.3 */
2/* Module-C: ESFormat-ItemOrder */
3
4#include <yaz/zes-order.h>
5
6int z_IORequest (ODR o, Z_IORequest **p, int opt, const char *name)
7{
8    if (!odr_sequence_begin (o, p, sizeof(**p), name))
9        return opt && odr_ok (o);
10    return
11        odr_explicit_tag (o, z_IOOriginPartToKeep,
12            &(*p)->toKeep, ODR_CONTEXT, 1, 1, "toKeep") &&
13        odr_explicit_tag (o, z_IOOriginPartNotToKeep,
14            &(*p)->notToKeep, ODR_CONTEXT, 2, 0, "notToKeep") &&
15        odr_sequence_end (o);
16}
17
18int z_IOTaskPackage (ODR o, Z_IOTaskPackage **p, int opt, const char *name)
19{
20    if (!odr_sequence_begin (o, p, sizeof(**p), name))
21        return opt && odr_ok (o);
22    return
23        odr_explicit_tag (o, z_IOOriginPartToKeep,
24            &(*p)->originPart, ODR_CONTEXT, 1, 1, "originPart") &&
25        odr_explicit_tag (o, z_IOTargetPart,
26            &(*p)->targetPart, ODR_CONTEXT, 2, 0, "targetPart") &&
27        odr_sequence_end (o);
28}
29
30int z_IOItemOrder (ODR o, Z_IOItemOrder **p, int opt, const char *name)
31{
32    static Odr_arm arm[] = {
33        {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IOItemOrder_esRequest,
34        (Odr_fun) z_IORequest, "esRequest"},
35        {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IOItemOrder_taskPackage,
36        (Odr_fun) z_IOTaskPackage, "taskPackage"},
37        {-1, -1, -1, -1, (Odr_fun) 0, 0}
38    };
39    if (!odr_initmember(o, p, sizeof(**p)))
40        return opt && odr_ok(o);
41    if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
42        return 1;
43    *p = 0;
44    return opt && odr_ok(o);
45}
46
47int z_IOContact (ODR o, Z_IOContact **p, int opt, const char *name)
48{
49    if (!odr_sequence_begin (o, p, sizeof(**p), name))
50        return opt && odr_ok (o);
51    return
52        odr_implicit_tag (o, z_InternationalString,
53            &(*p)->name, ODR_CONTEXT, 1, 1, "name") &&
54        odr_implicit_tag (o, z_InternationalString,
55            &(*p)->phone, ODR_CONTEXT, 2, 1, "phone") &&
56        odr_implicit_tag (o, z_InternationalString,
57            &(*p)->email, ODR_CONTEXT, 3, 1, "email") &&
58        odr_sequence_end (o);
59}
60
61int z_IOBilling (ODR o, Z_IOBilling **p, int opt, const char *name)
62{
63    static Odr_arm arm[] = {
64        {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_IOBilling_billInvoice,
65        (Odr_fun) odr_null, "billInvoice"},
66        {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IOBilling_prepay,
67        (Odr_fun) odr_null, "prepay"},
68        {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IOBilling_depositAccount,
69        (Odr_fun) odr_null, "depositAccount"},
70        {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IOBilling_creditCard,
71        (Odr_fun) z_IOCreditCardInfo, "creditCard"},
72        {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_IOBilling_cardInfoPreviouslySupplied,
73        (Odr_fun) odr_null, "cardInfoPreviouslySupplied"},
74        {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_IOBilling_privateKnown,
75        (Odr_fun) odr_null, "privateKnown"},
76        {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_IOBilling_privateNotKnown,
77        (Odr_fun) z_External, "privateNotKnown"},
78        {-1, -1, -1, -1, (Odr_fun) 0, 0}
79    };
80    if (!odr_sequence_begin (o, p, sizeof(**p), name))
81        return opt && odr_ok (o);
82    return
83        odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, "paymentMethod") &&
84        odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) &&
85        odr_constructed_end (o) &&
86        odr_implicit_tag (o, z_InternationalString,
87            &(*p)->customerReference, ODR_CONTEXT, 2, 1, "customerReference") &&
88        odr_implicit_tag (o, z_InternationalString,
89            &(*p)->customerPONumber, ODR_CONTEXT, 3, 1, "customerPONumber") &&
90        odr_sequence_end (o);
91}
92
93int z_IOOriginPartToKeep (ODR o, Z_IOOriginPartToKeep **p, int opt, const char *name)
94{
95    if (!odr_sequence_begin (o, p, sizeof(**p), name))
96        return opt && odr_ok (o);
97    return
98        odr_implicit_tag (o, z_External,
99            &(*p)->supplDescription, ODR_CONTEXT, 1, 1, "supplDescription") &&
100        odr_implicit_tag (o, z_IOContact,
101            &(*p)->contact, ODR_CONTEXT, 2, 1, "contact") &&
102        odr_implicit_tag (o, z_IOBilling,
103            &(*p)->addlBilling, ODR_CONTEXT, 3, 1, "addlBilling") &&
104        odr_sequence_end (o);
105}
106
107int z_IOCreditCardInfo (ODR o, Z_IOCreditCardInfo **p, int opt, const char *name)
108{
109    if (!odr_sequence_begin (o, p, sizeof(**p), name))
110        return opt && odr_ok (o);
111    return
112        odr_implicit_tag (o, z_InternationalString,
113            &(*p)->nameOnCard, ODR_CONTEXT, 1, 0, "nameOnCard") &&
114        odr_implicit_tag (o, z_InternationalString,
115            &(*p)->expirationDate, ODR_CONTEXT, 2, 0, "expirationDate") &&
116        odr_implicit_tag (o, z_InternationalString,
117            &(*p)->cardNumber, ODR_CONTEXT, 3, 0, "cardNumber") &&
118        odr_sequence_end (o);
119}
120
121int z_IOResultSetItem (ODR o, Z_IOResultSetItem **p, int opt, const char *name)
122{
123    if (!odr_sequence_begin (o, p, sizeof(**p), name))
124        return opt && odr_ok (o);
125    return
126        odr_implicit_tag (o, z_InternationalString,
127            &(*p)->resultSetId, ODR_CONTEXT, 1, 0, "resultSetId") &&
128        odr_implicit_tag (o, odr_integer,
129            &(*p)->item, ODR_CONTEXT, 2, 0, "item") &&
130        odr_sequence_end (o);
131}
132
133int z_IOOriginPartNotToKeep (ODR o, Z_IOOriginPartNotToKeep **p, int opt, const char *name)
134{
135    if (!odr_sequence_begin (o, p, sizeof(**p), name))
136        return opt && odr_ok (o);
137    return
138        odr_implicit_tag (o, z_IOResultSetItem,
139            &(*p)->resultSetItem, ODR_CONTEXT, 1, 1, "resultSetItem") &&
140        odr_implicit_tag (o, z_External,
141            &(*p)->itemRequest, ODR_CONTEXT, 2, 1, "itemRequest") &&
142        odr_sequence_end (o);
143}
144
145int z_IOTargetPart (ODR o, Z_IOTargetPart **p, int opt, const char *name)
146{
147    if (!odr_sequence_begin (o, p, sizeof(**p), name))
148        return opt && odr_ok (o);
149    return
150        odr_implicit_tag (o, z_External,
151            &(*p)->itemRequest, ODR_CONTEXT, 1, 1, "itemRequest") &&
152        odr_implicit_tag (o, z_External,
153            &(*p)->statusOrErrorReport, ODR_CONTEXT, 2, 1, "statusOrErrorReport") &&
154        odr_implicit_tag (o, odr_integer,
155            &(*p)->auxiliaryStatus, ODR_CONTEXT, 3, 1, "auxiliaryStatus") &&
156        odr_sequence_end (o);
157}
Note: See TracBrowser for help on using the browser.