2 * Copyright (c) 1999-2000, Index Data.
3 * See the file LICENSE for details.
6 * Revision 1.2 2000-01-15 09:38:51 adam
7 * Implemented ill_get_ILLRequest. Added some type mappings for ILL protocol.
9 * Revision 1.1 1999/12/16 23:36:19 adam
10 * Implemented ILL protocol. Minor updates ASN.1 compiler.
16 ILL_String *ill_get_ILL_String (ODR o, const char *str)
18 ILL_String *r = (ILL_String *) odr_malloc (o, sizeof(*r));
20 r->which = ILL_String_GeneralString;
21 r->u.GeneralString = odr_strdup (o, str);
25 ILL_Transaction_Id *ill_get_Transaction_Id (ODR o)
27 ILL_Transaction_Id *r = (ILL_Transaction_Id *) odr_malloc (o, sizeof(*r));
29 r->initial_requester_id = 0;
30 r->transaction_group_qualifier = ill_get_ILL_String (o, "group");
31 r->transaction_qualifier = ill_get_ILL_String (o, "qual");
32 r->sub_transaction_qualifier = 0;
37 ILL_Service_Date_this *ill_get_Service_Date_this (ODR o)
39 ILL_Service_Date_this *r =
40 (ILL_Service_Date_this *) odr_malloc (o, sizeof(*r));
41 r->date = odr_strdup (o, "14012000");
46 ILL_Service_Date_Time *ill_get_Service_Date_Time (ODR o)
48 ILL_Service_Date_Time *r =
49 (ILL_Service_Date_Time *) odr_malloc (o, sizeof(*r));
50 r->date_time_of_this_service = ill_get_Service_Date_this (o);
51 r->date_time_of_original_service = 0;
55 ILL_Transaction_Type *ill_get_Transaction_Type (ODR o)
57 ILL_Transaction_Type *r =
58 (ILL_Transaction_Type *) odr_malloc (o, sizeof(*r));
64 bool_t *ill_get_bool (ODR o, int val)
66 bool_t *r = odr_malloc (o, sizeof(*r));
71 int *ill_get_enumerated (ODR o, int val)
73 int *r = odr_malloc (o, sizeof(*r));
78 int *ill_get_int (ODR o, int val)
80 return ill_get_enumerated (o, val);
84 ILL_Requester_Optional_Messages_Type *ill_get_Requester_Optional_Messages_Type (ODR o)
86 ILL_Requester_Optional_Messages_Type *r =
87 (ILL_Requester_Optional_Messages_Type *) odr_malloc (o, sizeof(*r));
88 r->can_send_RECEIVED = ill_get_bool (o, 0);
89 r->can_send_RETURNED = ill_get_bool (o, 0);
90 r->requester_SHIPPED =
91 ill_get_enumerated (o, ILL_Requester_Optional_Messages_Type_requires);
92 r->requester_CHECKED_IN =
93 ill_get_enumerated (o, ILL_Requester_Optional_Messages_Type_requires);
97 ILL_Item_Id *ill_get_Item_Id (ODR o)
99 ILL_Item_Id *r = (ILL_Item_Id *) odr_malloc (o, sizeof(*r));
101 r->item_type = ill_get_enumerated (o, ILL_Item_Id_monograph);
102 r->held_medium_type = 0;
107 r->sponsoring_body = 0;
108 r->place_of_publication = 0;
110 r->series_title_number = 0;
113 r->publication_date = 0;
114 r->publication_date_of_component = 0;
115 r->author_of_article = 0;
116 r->title_of_article = 0;
118 r->national_bibliography_no = 0;
122 r->additional_no_letters = 0;
123 r->verification_reference_source = 0;
127 ILL_ItemRequest *ill_get_ItemRequest (ODR o)
129 ILL_ItemRequest *r = (ILL_ItemRequest *)odr_malloc(o, sizeof(*r));
131 r->protocol_version_num = ill_get_enumerated (o, ILL_Request_version_2);
133 r->transaction_id = 0;
134 r->service_date_time = 0;
137 r->transaction_type = ill_get_Transaction_Type (o);
138 r->delivery_address = 0;
139 r->delivery_service = 0;
140 r->billing_address = 0;
142 r->num_iLL_service_type = 1;
143 r->iLL_service_type = (ILL_Service_Type **)
144 odr_malloc (o, sizeof(*r->iLL_service_type));
145 *r->iLL_service_type =
146 ill_get_enumerated (o, ILL_Service_Type_copy_non_returnable);
148 r->responder_specific_service = 0;
149 r->requester_optional_messages = 0;
151 r->num_supply_medium_info_type = 0;
152 r->supply_medium_info_type = 0;
154 r->place_on_hold = (int*) odr_malloc(o, sizeof(int));
155 *r->place_on_hold = ILL_Place_On_Hold_Type_according_to_responder_policy;
159 r->supplemental_item_description = 0;
160 r->cost_info_type = 0;
161 r->copyright_compliance = 0;
162 r->third_party_info_type = 0;
163 r->retry_flag = ill_get_bool (o, 0);
164 r->forward_flag = ill_get_bool (o, 0);
165 r->requester_note = 0;
167 r->num_iLL_request_extensions = 0;
168 r->iLL_request_extensions = 0;
172 ILL_Request *ill_get_ILLRequest (ODR o)
174 ILL_Request *r = (ILL_Request *) odr_malloc(o, sizeof(*r));
176 r->protocol_version_num = ill_get_enumerated (o, ILL_Request_version_2);
178 r->transaction_id = ill_get_Transaction_Id (o);
180 r->service_date_time = ill_get_Service_Date_Time (o);
183 r->transaction_type = ill_get_Transaction_Type(o);
184 r->delivery_address = 0;
185 r->delivery_service = 0;
186 r->billing_address = 0;
188 r->num_iLL_service_type = 1;
189 r->iLL_service_type = (ILL_Service_Type **)
190 odr_malloc (o, sizeof(*r->iLL_service_type));
191 *r->iLL_service_type =
192 ill_get_enumerated (o, ILL_Service_Type_copy_non_returnable);
194 r->responder_specific_service = 0;
195 r->requester_optional_messages =
196 ill_get_Requester_Optional_Messages_Type (o);;
198 r->num_supply_medium_info_type = 0;
199 r->supply_medium_info_type = 0;
201 r->place_on_hold = (int*) odr_malloc(o, sizeof(int));
202 *r->place_on_hold = ILL_Place_On_Hold_Type_according_to_responder_policy;
205 r->item_id = ill_get_Item_Id (o);
206 r->supplemental_item_description = 0;
207 r->cost_info_type = 0;
208 r->copyright_compliance = 0;
209 r->third_party_info_type = 0;
210 r->retry_flag = ill_get_bool (o, 0);
211 r->forward_flag = ill_get_bool (o, 0);
212 r->requester_note = 0;
214 r->num_iLL_request_extensions = 0;
215 r->iLL_request_extensions = 0;