Z_External *p;
int len = strlen(buf);
- if (!(p = (Z_External *)odr_malloc(o, sizeof(*p)))) return 0;
-
+ if (!(p = (Z_External *)odr_malloc(o, sizeof(*p))))
+ return 0;
p->descriptor = 0;
p->indirect_reference = 0;
p->direct_reference = odr_oiddup(o, yaz_oid_negot_charset_id);
p->which = Z_External_octet;
- if (!(p->u.octet_aligned = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct)))) {
+ if (!(p->u.octet_aligned = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct))))
return 0;
- }
- if (!(p->u.octet_aligned->buf = (unsigned char *)odr_malloc(o, len))) {
+ if (!(p->u.octet_aligned->buf = (unsigned char *)odr_malloc(o, len)))
return 0;
- }
p->u.octet_aligned->len = p->u.octet_aligned->size = len;
memcpy(p->u.octet_aligned->buf, buf, len);
{
int form = -1;
-
if (!yaz_matchstr(charset, "UCS-2"))
form = 2;
if (!yaz_matchstr(charset, "UCS-4"))
return form;
}
-static char *set_form (Odr_oid *encoding)
+static char *set_form(Odr_oid *encoding)
{
static char *charset = 0;
if ( oid_oidlen(encoding) != 6)
static Z_OriginProposal_0 *z_get_OriginProposal_0(ODR o, const char *charset)
{
- int form = get_form (charset);
+ int form = get_form(charset);
Z_OriginProposal_0 *p0 =
(Z_OriginProposal_0*)odr_malloc(o, sizeof(*p0));
{ /* ISO 10646 (UNICODE) */
char oidname[20];
- Z_Iso10646 *is = (Z_Iso10646 *) odr_malloc (o, sizeof(*is));
+ Z_Iso10646 *is = (Z_Iso10646 *) odr_malloc(o, sizeof(*is));
p0->which = Z_OriginProposal_0_iso10646;
p0->u.iso10646 = is;
is->collections = 0;
- sprintf (oidname, "1.0.10646.1.0.%d", form);
- is->encodingLevel = odr_getoidbystr (o, oidname);
+ sprintf(oidname, "1.0.10646.1.0.%d", form);
+ is->encodingLevel = odr_getoidbystr(o, oidname);
}
else
{ /* private ones */
memset(p, 0, sizeof(*p));
p->recordsInSelectedCharSets = (bool_t *)odr_malloc(o, sizeof(bool_t));
- *p->recordsInSelectedCharSets = (selected) ? 1:0;
+ *p->recordsInSelectedCharSets = (selected) ? 1 : 0;
- if (charsets && num_charsets) {
-
+ if (charsets && num_charsets)
+ {
p->num_proposedCharSets = num_charsets;
p->proposedCharSets =
(Z_OriginProposal_0**)
odr_malloc(o, num_charsets*sizeof(Z_OriginProposal_0*));
- for (i = 0; i<num_charsets; i++)
+ for (i = 0; i < num_charsets; i++)
p->proposedCharSets[i] =
z_get_OriginProposal_0(o, charsets[i]);
}
- if (langs && num_langs) {
-
+ if (langs && num_langs)
+ {
p->num_proposedlanguages = num_langs;
-
p->proposedlanguages =
(char **) odr_malloc(o, num_langs*sizeof(char *));
- for (i = 0; i<num_langs; i++) {
-
+ for (i = 0; i < num_langs; i++)
p->proposedlanguages[i] = (char *)langs[i];
-
- }
}
return p;
}
int form = get_form(charset);
memset(p, 0, sizeof(*p));
-
if (form > 0)
{
char oidname[20];
p->which = Z_TargetResponse_iso10646;
p->u.iso10646 = is;
is->collections = 0;
- sprintf (oidname, "1.0.10646.1.0.%d", form);
+ sprintf(oidname, "1.0.10646.1.0.%d", form);
is->encodingLevel = odr_getoidbystr (o, oidname);
}
else
z_ext_record2(o, charset);
}
p->recordsInSelectedCharSets = (bool_t *)odr_malloc(o, sizeof(bool_t));
- *p->recordsInSelectedCharSets = (selected) ? 1:0;
+ *p->recordsInSelectedCharSets = (selected) ? 1 : 0;
- p->selectedLanguage = lang ? (char *)odr_strdup(o, lang) : 0;
+ p->selectedLanguage = lang ? (char *) odr_strdup(o, lang) : 0;
return p;
}
if (!p)
return 0;
- for (i = 0; i < p->num_elements; i++) {
+ for (i = 0; i < p->num_elements; i++)
+ {
Z_External *pext;
if ((p->list[i]->which == Z_OtherInfo_externallyDefinedInfo) &&
- (pext = p->list[i]->information.externallyDefinedInfo)) {
-
+ (pext = p->list[i]->information.externallyDefinedInfo))
+ {
if (!oid_oidcmp(pext->direct_reference, yaz_oid_negot_charset_3)
&& pext->which == Z_External_charSetandLanguageNegotiation)
{
if (!*p)
return 0;
- for (i = 0; i < (*p)->num_elements; i++) {
+ for (i = 0; i < (*p)->num_elements; i++)
+ {
Z_External *pext;
if (((*p)->list[i]->which == Z_OtherInfo_externallyDefinedInfo) &&
(pext = (*p)->list[i]->information.externallyDefinedInfo))
else
{
--((*p)->num_elements);
- for(; i < (*p)->num_elements; i++)
+ for (; i < (*p)->num_elements; i++)
(*p)->list[i] = (*p)->list[i+1];
}
return 1;
(*charsets) = (char **)
nmem_malloc(mem, pro->num_proposedCharSets * sizeof(char *));
- for (i=0; i<pro->num_proposedCharSets; i++)
+ for (i = 0; i < pro->num_proposedCharSets; i++)
{
(*charsets)[i] = 0;
if (pro->proposedCharSets[i]->which ==
Z_OriginProposal_0_private &&
pro->proposedCharSets[i]->u.zprivate->which ==
- Z_PrivateCharacterSet_externallySpecified) {
-
+ Z_PrivateCharacterSet_externallySpecified)
+ {
Z_External *pext =
pro->proposedCharSets[i]->u.zprivate->u.externallySpecified;
- if (pext->which == Z_External_octet) {
-
+ if (pext->which == Z_External_octet)
+ {
(*charsets)[i] = (char *)
nmem_malloc(mem, (1+pext->u.octet_aligned->len) *
sizeof(char));
- memcpy ((*charsets)[i], pext->u.octet_aligned->buf,
- pext->u.octet_aligned->len);
+ memcpy((*charsets)[i], pext->u.octet_aligned->buf,
+ pext->u.octet_aligned->len);
(*charsets)[i][pext->u.octet_aligned->len] = 0;
-
}
}
else if (pro->proposedCharSets[i]->which ==
Z_OriginProposal_0_iso10646)
- (*charsets)[i] = set_form (
+ (*charsets)[i] = set_form(
pro->proposedCharSets[i]->u.iso10646->encodingLevel);
}
}
(*langs) = (char **)
nmem_malloc(mem, pro->num_proposedlanguages * sizeof(char *));
- for (i=0; i<pro->num_proposedlanguages; i++)
+ for (i = 0; i < pro->num_proposedlanguages; i++)
(*langs)[i] = nmem_strdup(mem, pro->proposedlanguages[i]);
}
else
*num_langs = 0;
}
- if(pro->recordsInSelectedCharSets && selected)
+ if (pro->recordsInSelectedCharSets && selected)
*selected = *pro->recordsInSelectedCharSets;
}
Z_TargetResponse *res = p->u.response;
if (charset && res->which == Z_TargetResponse_private &&
- res->u.zprivate->which == Z_PrivateCharacterSet_externallySpecified) {
-
+ res->u.zprivate->which == Z_PrivateCharacterSet_externallySpecified)
+ {
Z_External *pext = res->u.zprivate->u.externallySpecified;
- if (pext->which == Z_External_octet) {
-
+ if (pext->which == Z_External_octet)
+ {
*charset = (char *)
nmem_malloc(mem, (1+pext->u.octet_aligned->len)*sizeof(char));
- memcpy (*charset, pext->u.octet_aligned->buf,
- pext->u.octet_aligned->len);
+ memcpy(*charset, pext->u.octet_aligned->buf,
+ pext->u.octet_aligned->len);
(*charset)[pext->u.octet_aligned->len] = 0;
}
}
if (charset && res->which == Z_TargetResponse_iso10646)
- *charset = set_form (res->u.iso10646->encodingLevel);
+ *charset = set_form(res->u.iso10646->encodingLevel);
if (lang && res->selectedLanguage)
- *lang = nmem_strdup (mem, res->selectedLanguage);
+ *lang = nmem_strdup(mem, res->selectedLanguage);
- if(selected && res->recordsInSelectedCharSets)
+ if (selected && res->recordsInSelectedCharSets)
*selected = *res->recordsInSelectedCharSets;
}
/*
#include <stdlib.h>
#include <yaz/ill.h>
-bool_t *ill_get_bool (struct ill_get_ctl *gc, const char *name,
- const char *sub, int val)
+bool_t *ill_get_bool(struct ill_get_ctl *gc, const char *name,
+ const char *sub, int val)
{
ODR o = gc->odr;
char element[128];
const char *v;
- bool_t *r = (bool_t *) odr_malloc (o, sizeof(*r));
+ bool_t *r = (bool_t *) odr_malloc(o, sizeof(*r));
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
v = (gc->f)(gc->clientData, element);
}
Odr_int *ill_get_int(struct ill_get_ctl *gc, const char *name,
- const char *sub, Odr_int val)
+ const char *sub, Odr_int val)
{
ODR o = gc->odr;
char element[128];
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
v = (gc->f)(gc->clientData, element);
if (v)
return odr_intdup(o, val);
}
-Odr_int *ill_get_enumerated (struct ill_get_ctl *gc, const char *name,
- const char *sub, Odr_int val)
+Odr_int *ill_get_enumerated(struct ill_get_ctl *gc, const char *name,
+ const char *sub, Odr_int val)
{
return ill_get_int(gc, name, sub, val);
}
-ILL_String *ill_get_ILL_String_x (struct ill_get_ctl *gc, const char *name,
- const char *sub, const char *vdefault)
+ILL_String *ill_get_ILL_String_x(struct ill_get_ctl *gc, const char *name,
+ const char *sub, const char *vdefault)
{
- ILL_String *r = (ILL_String *) odr_malloc (gc->odr, sizeof(*r));
+ ILL_String *r = (ILL_String *) odr_malloc(gc->odr, sizeof(*r));
char element[128];
const char *v;
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
v = (gc->f)(gc->clientData, element);
if (!v)
if (!v)
return 0;
r->which = ILL_String_GeneralString;
- r->u.GeneralString = odr_strdup (gc->odr, v);
+ r->u.GeneralString = odr_strdup(gc->odr, v);
return r;
}
ILL_String *ill_get_ILL_String(struct ill_get_ctl *gc, const char *name,
const char *sub)
{
- return ill_get_ILL_String_x (gc, name, sub, 0);
+ return ill_get_ILL_String_x(gc, name, sub, 0);
}
-ILL_ISO_Date *ill_get_ILL_ISO_Date (struct ill_get_ctl *gc, const char *name,
- const char *sub, const char *val)
+ILL_ISO_Date *ill_get_ILL_ISO_Date(struct ill_get_ctl *gc, const char *name,
+ const char *sub, const char *val)
{
char element[128];
const char *v;
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
v = (gc->f)(gc->clientData, element);
if (!v)
v = val;
if (!v)
return 0;
- return odr_strdup (gc->odr, v);
+ return odr_strdup(gc->odr, v);
}
-ILL_ISO_Time *ill_get_ILL_ISO_Time (struct ill_get_ctl *gc, const char *name,
- const char *sub, const char *val)
+ILL_ISO_Time *ill_get_ILL_ISO_Time(struct ill_get_ctl *gc, const char *name,
+ const char *sub, const char *val)
{
char element[128];
const char *v;
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
v = (gc->f)(gc->clientData, element);
if (!v)
v = val;
if (!v)
return 0;
- return odr_strdup (gc->odr, v);
+ return odr_strdup(gc->odr, v);
}
-ILL_Person_Or_Institution_Symbol *ill_get_Person_Or_Insitution_Symbol (
+ILL_Person_Or_Institution_Symbol *ill_get_Person_Or_Insitution_Symbol(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
char element[128];
ODR o = gc->odr;
ILL_Person_Or_Institution_Symbol *p =
- (ILL_Person_Or_Institution_Symbol *) odr_malloc (o, sizeof(*p));
+ (ILL_Person_Or_Institution_Symbol *) odr_malloc(o, sizeof(*p));
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
p->which = ILL_Person_Or_Institution_Symbol_person_symbol;
- if ((p->u.person_symbol = ill_get_ILL_String (gc, element, "person")))
+ if ((p->u.person_symbol = ill_get_ILL_String(gc, element, "person")))
return p;
p->which = ILL_Person_Or_Institution_Symbol_institution_symbol;
if ((p->u.institution_symbol =
- ill_get_ILL_String (gc, element, "institution")))
+ ill_get_ILL_String(gc, element, "institution")))
return p;
return 0;
}
char element[128];
ODR o = gc->odr;
ILL_Name_Of_Person_Or_Institution *p =
- (ILL_Name_Of_Person_Or_Institution *) odr_malloc (o, sizeof(*p));
+ (ILL_Name_Of_Person_Or_Institution *) odr_malloc(o, sizeof(*p));
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
p->which = ILL_Name_Of_Person_Or_Institution_name_of_person;
if ((p->u.name_of_person =
- ill_get_ILL_String (gc, element, "name-of-person")))
+ ill_get_ILL_String(gc, element, "name-of-person")))
return p;
p->which = ILL_Name_Of_Person_Or_Institution_name_of_institution;
if ((p->u.name_of_institution =
- ill_get_ILL_String (gc, element, "name-of-institution")))
+ ill_get_ILL_String(gc, element, "name-of-institution")))
return p;
return 0;
}
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
- p = (ILL_System_Id *) odr_malloc (o, sizeof(*p));
- p->person_or_institution_symbol = ill_get_Person_Or_Insitution_Symbol (
+ p = (ILL_System_Id *) odr_malloc(o, sizeof(*p));
+ p->person_or_institution_symbol = ill_get_Person_Or_Insitution_Symbol(
gc, element, "person-or-institution-symbol");
- p->name_of_person_or_institution = ill_get_Name_Of_Person_Or_Institution (
+ p->name_of_person_or_institution = ill_get_Name_Of_Person_Or_Institution(
gc, element, "name-of-person-or-institution");
return p;
}
-ILL_Transaction_Id *ill_get_Transaction_Id (struct ill_get_ctl *gc,
- const char *name, const char *sub)
+ILL_Transaction_Id *ill_get_Transaction_Id(struct ill_get_ctl *gc,
+ const char *name, const char *sub)
{
ODR o = gc->odr;
- ILL_Transaction_Id *r = (ILL_Transaction_Id *) odr_malloc (o, sizeof(*r));
+ ILL_Transaction_Id *r = (ILL_Transaction_Id *) odr_malloc(o, sizeof(*r));
char element[128];
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
r->initial_requester_id =
- ill_get_System_Id (gc, element, "initial-requester-id");
+ ill_get_System_Id(gc, element, "initial-requester-id");
r->transaction_group_qualifier =
- ill_get_ILL_String_x (gc, element, "transaction-group-qualifier", "");
+ ill_get_ILL_String_x(gc, element, "transaction-group-qualifier", "");
r->transaction_qualifier =
- ill_get_ILL_String_x (gc, element, "transaction-qualifier", "");
+ ill_get_ILL_String_x(gc, element, "transaction-qualifier", "");
r->sub_transaction_qualifier =
- ill_get_ILL_String (gc, element, "sub-transaction-qualifier");
+ ill_get_ILL_String(gc, element, "sub-transaction-qualifier");
return r;
}
-ILL_Service_Date_this *ill_get_Service_Date_this (
+ILL_Service_Date_this *ill_get_Service_Date_this(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
ILL_Service_Date_this *r =
- (ILL_Service_Date_this *) odr_malloc (o, sizeof(*r));
+ (ILL_Service_Date_this *) odr_malloc(o, sizeof(*r));
char element[128];
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
- r->date = ill_get_ILL_ISO_Date (gc, element, "date", "20000101");
- r->time = ill_get_ILL_ISO_Time (gc, element, "time", 0);
+ r->date = ill_get_ILL_ISO_Date(gc, element, "date", "20000101");
+ r->time = ill_get_ILL_ISO_Time(gc, element, "time", 0);
return r;
}
-ILL_Service_Date_original *ill_get_Service_Date_original (
+ILL_Service_Date_original *ill_get_Service_Date_original(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
ILL_Service_Date_original *r =
- (ILL_Service_Date_original *) odr_malloc (o, sizeof(*r));
+ (ILL_Service_Date_original *) odr_malloc(o, sizeof(*r));
char element[128];
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
- r->date = ill_get_ILL_ISO_Date (gc, element, "date", 0);
- r->time = ill_get_ILL_ISO_Time (gc, element, "time", 0);
+ r->date = ill_get_ILL_ISO_Date(gc, element, "date", 0);
+ r->time = ill_get_ILL_ISO_Time(gc, element, "time", 0);
if (!r->date && !r->time)
return 0;
return r;
}
-ILL_Service_Date_Time *ill_get_Service_Date_Time (
+ILL_Service_Date_Time *ill_get_Service_Date_Time(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
ILL_Service_Date_Time *r =
- (ILL_Service_Date_Time *) odr_malloc (o, sizeof(*r));
+ (ILL_Service_Date_Time *) odr_malloc(o, sizeof(*r));
char element[128];
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
- r->date_time_of_this_service = ill_get_Service_Date_this (
+ r->date_time_of_this_service = ill_get_Service_Date_this(
gc, element, "this");
- r->date_time_of_original_service = ill_get_Service_Date_original (
+ r->date_time_of_original_service = ill_get_Service_Date_original(
gc, element, "original");
return r;
}
-ILL_Requester_Optional_Messages_Type *ill_get_Requester_Optional_Messages_Type (
+ILL_Requester_Optional_Messages_Type *ill_get_Requester_Optional_Messages_Type(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
ILL_Requester_Optional_Messages_Type *r =
- (ILL_Requester_Optional_Messages_Type *) odr_malloc (o, sizeof(*r));
+ (ILL_Requester_Optional_Messages_Type *) odr_malloc(o, sizeof(*r));
char element[128];
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
- r->can_send_RECEIVED = ill_get_bool (gc, element, "can-send-RECEIVED", 0);
- r->can_send_RETURNED = ill_get_bool (gc, element, "can-send-RETURNED", 0);
+ r->can_send_RECEIVED = ill_get_bool(gc, element, "can-send-RECEIVED", 0);
+ r->can_send_RETURNED = ill_get_bool(gc, element, "can-send-RETURNED", 0);
r->requester_SHIPPED =
- ill_get_enumerated (gc, element, "requester-SHIPPED", 1);
+ ill_get_enumerated(gc, element, "requester-SHIPPED", 1);
r->requester_CHECKED_IN =
- ill_get_enumerated (gc, element, "requester-CHECKED-IN", 1);
+ ill_get_enumerated(gc, element, "requester-CHECKED-IN", 1);
return r;
}
-ILL_Item_Id *ill_get_Item_Id (
+ILL_Item_Id *ill_get_Item_Id(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
- ILL_Item_Id *r = (ILL_Item_Id *) odr_malloc (o, sizeof(*r));
+ ILL_Item_Id *r = (ILL_Item_Id *) odr_malloc(o, sizeof(*r));
char element[128];
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
- r->item_type = ill_get_enumerated (gc, element, "item-type",
- ILL_Item_Id_monograph);
+ r->item_type = ill_get_enumerated(gc, element, "item-type",
+ ILL_Item_Id_monograph);
r->held_medium_type = 0;
r->call_number = ill_get_ILL_String(gc, element, "call-number");
r->author = ill_get_ILL_String(gc, element, "author");
}
-ILL_Client_Id *ill_get_Client_Id (
+ILL_Client_Id *ill_get_Client_Id(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
char element[128];
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
- r->client_name = ill_get_ILL_String (gc, element, "client-name");
- r->client_status = ill_get_ILL_String (gc, element, "client-status");
- r->client_identifier = ill_get_ILL_String (gc, element,
- "client-identifier");
+ r->client_name = ill_get_ILL_String(gc, element, "client-name");
+ r->client_status = ill_get_ILL_String(gc, element, "client-status");
+ r->client_identifier = ill_get_ILL_String(gc, element,
+ "client-identifier");
return r;
}
-ILL_Postal_Address *ill_get_Postal_Address (
+ILL_Postal_Address *ill_get_Postal_Address(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
r->name_of_person_or_institution =
- ill_get_Name_Of_Person_Or_Institution (
+ ill_get_Name_Of_Person_Or_Institution(
gc, element, "name-of-person-or-institution");
r->extended_postal_delivery_address =
- ill_get_ILL_String (
+ ill_get_ILL_String(
gc, element, "extended-postal-delivery-address");
r->street_and_number =
- ill_get_ILL_String (gc, element, "street-and-number");
+ ill_get_ILL_String(gc, element, "street-and-number");
r->post_office_box =
- ill_get_ILL_String (gc, element, "post-office-box");
- r->city = ill_get_ILL_String (gc, element, "city");
- r->region = ill_get_ILL_String (gc, element, "region");
- r->country = ill_get_ILL_String (gc, element, "country");
- r->postal_code = ill_get_ILL_String (gc, element, "postal-code");
+ ill_get_ILL_String(gc, element, "post-office-box");
+ r->city = ill_get_ILL_String(gc, element, "city");
+ r->region = ill_get_ILL_String(gc, element, "region");
+ r->country = ill_get_ILL_String(gc, element, "country");
+ r->postal_code = ill_get_ILL_String(gc, element, "postal-code");
return r;
}
-ILL_System_Address *ill_get_System_Address (
+ILL_System_Address *ill_get_System_Address(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
r->telecom_service_identifier =
- ill_get_ILL_String (gc, element, "telecom-service-identifier");
+ ill_get_ILL_String(gc, element, "telecom-service-identifier");
r->telecom_service_address =
- ill_get_ILL_String (gc, element, "telecom-service-addreess");
+ ill_get_ILL_String(gc, element, "telecom-service-addreess");
return r;
}
-ILL_Delivery_Address *ill_get_Delivery_Address (
+ILL_Delivery_Address *ill_get_Delivery_Address(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
r->postal_address =
- ill_get_Postal_Address (gc, element, "postal-address");
+ ill_get_Postal_Address(gc, element, "postal-address");
r->electronic_address =
- ill_get_System_Address (gc, element, "electronic-address");
+ ill_get_System_Address(gc, element, "electronic-address");
return r;
}
-ILL_Search_Type *ill_get_Search_Type (
+ILL_Search_Type *ill_get_Search_Type(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
- r->level_of_service = ill_get_ILL_String (gc, element, "level-of-service");
- r->need_before_date = ill_get_ILL_ISO_Date (gc, element,
- "need-before-date", 0);
- r->expiry_date = ill_get_ILL_ISO_Date (gc, element, "expiry-date", 0);
- r->expiry_flag = ill_get_enumerated (gc, element, "expiry-flag", 3);
+ r->level_of_service = ill_get_ILL_String(gc, element, "level-of-service");
+ r->need_before_date = ill_get_ILL_ISO_Date(gc, element,
+ "need-before-date", 0);
+ r->expiry_date = ill_get_ILL_ISO_Date(gc, element, "expiry-date", 0);
+ r->expiry_flag = ill_get_enumerated(gc, element, "expiry-flag", 3);
return r;
}
-ILL_Request *ill_get_ILLRequest (
+ILL_Request *ill_get_ILLRequest(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
r->protocol_version_num =
- ill_get_enumerated (gc, element, "protocol-version-num",
- ILL_Request_version_2);
+ ill_get_enumerated(gc, element, "protocol-version-num",
+ ILL_Request_version_2);
- r->transaction_id = ill_get_Transaction_Id (gc, element, "transaction-id");
+ r->transaction_id = ill_get_Transaction_Id(gc, element, "transaction-id");
r->service_date_time =
- ill_get_Service_Date_Time (gc, element, "service-date-time");
- r->requester_id = ill_get_System_Id (gc, element, "requester-id");
- r->responder_id = ill_get_System_Id (gc, element, "responder-id");
+ ill_get_Service_Date_Time(gc, element, "service-date-time");
+ r->requester_id = ill_get_System_Id(gc, element, "requester-id");
+ r->responder_id = ill_get_System_Id(gc, element, "responder-id");
r->transaction_type =
ill_get_enumerated(gc, element, "transaction-type", 1);
r->delivery_address =
- ill_get_Delivery_Address (gc, element, "delivery-address");
+ ill_get_Delivery_Address(gc, element, "delivery-address");
r->delivery_service = 0; /* TODO */
- /* ill_get_Delivery_Service (gc, element, "delivery-service"); */
+ /* ill_get_Delivery_Service(gc, element, "delivery-service"); */
r->billing_address =
- ill_get_Delivery_Address (gc, element, "billing-address");
+ ill_get_Delivery_Address(gc, element, "billing-address");
r->num_iLL_service_type = 1;
- r->iLL_service_type = (ILL_Service_Type **)
- odr_malloc (o, sizeof(*r->iLL_service_type));
+ r->iLL_service_type =(ILL_Service_Type **)
+ odr_malloc(o, sizeof(*r->iLL_service_type));
*r->iLL_service_type =
- ill_get_enumerated (gc, element, "ill-service-type",
- ILL_Service_Type_copy_non_returnable);
+ ill_get_enumerated(gc, element, "ill-service-type",
+ ILL_Service_Type_copy_non_returnable);
r->responder_specific_service = 0;
r->requester_optional_messages =
- ill_get_Requester_Optional_Messages_Type (
+ ill_get_Requester_Optional_Messages_Type(
gc, element,"requester-optional-messages");
r->search_type = ill_get_Search_Type(gc, element, "search-type");
r->num_supply_medium_info_type = 0;
r->supply_medium_info_type = 0;
- r->place_on_hold = ill_get_enumerated (
+ r->place_on_hold = ill_get_enumerated(
gc, element, "place-on-hold",
ILL_Place_On_Hold_Type_according_to_responder_policy);
- r->client_id = ill_get_Client_Id (gc, element, "client-id");
+ r->client_id = ill_get_Client_Id(gc, element, "client-id");
- r->item_id = ill_get_Item_Id (gc, element, "item-id");
+ r->item_id = ill_get_Item_Id(gc, element, "item-id");
r->supplemental_item_description = 0;
r->cost_info_type = 0;
r->copyright_compliance =
ill_get_ILL_String(gc, element, "copyright-complicance");
r->third_party_info_type = 0;
- r->retry_flag = ill_get_bool (gc, element, "retry-flag", 0);
- r->forward_flag = ill_get_bool (gc, element, "forward-flag", 0);
+ r->retry_flag = ill_get_bool(gc, element, "retry-flag", 0);
+ r->forward_flag = ill_get_bool(gc, element, "forward-flag", 0);
r->requester_note = ill_get_ILL_String(gc, element, "requester-note");
r->forward_note = ill_get_ILL_String(gc, element, "forward-note");
r->num_iLL_request_extensions = 0;
return r;
}
-ILL_ItemRequest *ill_get_ItemRequest (
+ILL_ItemRequest *ill_get_ItemRequest(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
r->protocol_version_num =
- ill_get_enumerated (gc, element, "protocol-version-num",
- ILL_Request_version_2);
+ ill_get_enumerated(gc, element, "protocol-version-num",
+ ILL_Request_version_2);
- r->transaction_id = ill_get_Transaction_Id (gc, element, "transaction-id");
+ r->transaction_id = ill_get_Transaction_Id(gc, element, "transaction-id");
r->service_date_time =
- ill_get_Service_Date_Time (gc, element, "service-date-time");
- r->requester_id = ill_get_System_Id (gc, element, "requester-id");
- r->responder_id = ill_get_System_Id (gc, element, "responder-id");
+ ill_get_Service_Date_Time(gc, element, "service-date-time");
+ r->requester_id = ill_get_System_Id(gc, element, "requester-id");
+ r->responder_id = ill_get_System_Id(gc, element, "responder-id");
r->transaction_type =
ill_get_enumerated(gc, element, "transaction-type", 1);
r->delivery_address =
- ill_get_Delivery_Address (gc, element, "delivery-address");
+ ill_get_Delivery_Address(gc, element, "delivery-address");
r->delivery_service = 0; /* TODO */
- /* ill_get_Delivery_Service (gc, element, "delivery-service"); */
+ /* ill_get_Delivery_Service(gc, element, "delivery-service"); */
r->billing_address =
- ill_get_Delivery_Address (gc, element, "billing-address");
+ ill_get_Delivery_Address(gc, element, "billing-address");
r->num_iLL_service_type = 1;
- r->iLL_service_type = (ILL_Service_Type **)
- odr_malloc (o, sizeof(*r->iLL_service_type));
+ r->iLL_service_type =(ILL_Service_Type **)
+ odr_malloc(o, sizeof(*r->iLL_service_type));
*r->iLL_service_type =
- ill_get_enumerated (gc, element, "ill-service-type",
- ILL_Service_Type_copy_non_returnable);
+ ill_get_enumerated(gc, element, "ill-service-type",
+ ILL_Service_Type_copy_non_returnable);
r->responder_specific_service = 0;
r->requester_optional_messages =
- ill_get_Requester_Optional_Messages_Type (
+ ill_get_Requester_Optional_Messages_Type(
gc, element,"requester-optional-messages");
r->search_type = ill_get_Search_Type(gc, element, "search-type");
r->num_supply_medium_info_type = 0;
r->supply_medium_info_type = 0;
- r->place_on_hold = ill_get_enumerated (
+ r->place_on_hold = ill_get_enumerated(
gc, element, "place-on-hold",
ILL_Place_On_Hold_Type_according_to_responder_policy);
- r->client_id = ill_get_Client_Id (gc, element, "client-id");
+ r->client_id = ill_get_Client_Id(gc, element, "client-id");
- r->item_id = ill_get_Item_Id (gc, element, "item-id");
+ r->item_id = ill_get_Item_Id(gc, element, "item-id");
r->supplemental_item_description = 0;
r->cost_info_type = 0;
r->copyright_compliance =
ill_get_ILL_String(gc, element, "copyright-complicance");
r->third_party_info_type = 0;
- r->retry_flag = ill_get_bool (gc, element, "retry-flag", 0);
- r->forward_flag = ill_get_bool (gc, element, "forward-flag", 0);
+ r->retry_flag = ill_get_bool(gc, element, "retry-flag", 0);
+ r->forward_flag = ill_get_bool(gc, element, "forward-flag", 0);
r->requester_note = ill_get_ILL_String(gc, element, "requester-note");
r->forward_note = ill_get_ILL_String(gc, element, "forward-note");
r->num_iLL_request_extensions = 0;
return r;
}
-ILL_Cancel *ill_get_Cancel (
+ILL_Cancel *ill_get_Cancel(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
strcpy(element, name);
if (sub)
{
- strcat (element, ",");
- strcat (element, sub);
+ strcat(element, ",");
+ strcat(element, sub);
}
r->protocol_version_num =
- ill_get_enumerated (gc, element, "protocol-version-num",
- ILL_Request_version_2);
+ ill_get_enumerated(gc, element, "protocol-version-num",
+ ILL_Request_version_2);
- r->transaction_id = ill_get_Transaction_Id (gc, element, "transaction-id");
+ r->transaction_id = ill_get_Transaction_Id(gc, element, "transaction-id");
r->service_date_time =
- ill_get_Service_Date_Time (gc, element, "service-date-time");
- r->requester_id = ill_get_System_Id (gc, element, "requester-id");
- r->responder_id = ill_get_System_Id (gc, element, "responder-id");
+ ill_get_Service_Date_Time(gc, element, "service-date-time");
+ r->requester_id = ill_get_System_Id(gc, element, "requester-id");
+ r->responder_id = ill_get_System_Id(gc, element, "responder-id");
r->requester_note = ill_get_ILL_String(gc, element, "requester-note");
r->num_cancel_extensions = 0;
return r;
}
-ILL_APDU *ill_get_APDU (
+ILL_APDU *ill_get_APDU(
struct ill_get_ctl *gc, const char *name, const char *sub)
{
ODR o = gc->odr;
char element[128];
const char *v;
- strcpy (element, name);
- strcat (element, ",which");
+ strcpy(element, name);
+ strcat(element, ",which");
v = (gc->f)(gc->clientData, element);
if (!v)
v = "request";
- if (!strcmp (v, "request"))
+ if (!strcmp(v, "request"))
{
r->which = ILL_APDU_ILL_Request;
r->u.illRequest = ill_get_ILLRequest(gc, name, sub);
}
- else if (!strcmp (v, "cancel"))
+ else if (!strcmp(v, "cancel"))
{
r->which = ILL_APDU_Cancel;
r->u.Cancel = ill_get_Cancel(gc, name, sub);