/**
* \file charneg.c
* \brief Implements Z39.50 Charset negotiation utilities
*
* Helper functions for Character Set and Language Negotiation - 3
*/
/**
* \file charneg.c
* \brief Implements Z39.50 Charset negotiation utilities
*
* Helper functions for Character Set and Language Negotiation - 3
*/
p->descriptor = 0;
p->indirect_reference = 0;
p->direct_reference = odr_oiddup(o, yaz_oid_negot_charset_id);
p->which = Z_External_octet;
p->descriptor = 0;
p->indirect_reference = 0;
p->direct_reference = odr_oiddup(o, yaz_oid_negot_charset_id);
p->which = Z_External_octet;
p->u.octet_aligned->len = p->u.octet_aligned->size = len;
memcpy(p->u.octet_aligned->buf, buf, len);
p->u.octet_aligned->len = p->u.octet_aligned->size = len;
memcpy(p->u.octet_aligned->buf, buf, len);
if (!yaz_matchstr(charset, "UCS-2"))
form = 2;
if (!yaz_matchstr(charset, "UCS-4"))
if (!yaz_matchstr(charset, "UCS-2"))
form = 2;
if (!yaz_matchstr(charset, "UCS-4"))
- 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);
memset(p, 0, sizeof(*p));
p->recordsInSelectedCharSets = (bool_t *)odr_malloc(o, sizeof(bool_t));
memset(p, 0, sizeof(*p));
p->recordsInSelectedCharSets = (bool_t *)odr_malloc(o, sizeof(bool_t));
p->num_proposedCharSets = num_charsets;
p->proposedCharSets =
(Z_OriginProposal_0**)
odr_malloc(o, num_charsets*sizeof(Z_OriginProposal_0*));
p->num_proposedCharSets = num_charsets;
p->proposedCharSets =
(Z_OriginProposal_0**)
odr_malloc(o, num_charsets*sizeof(Z_OriginProposal_0*));
int form = get_form(charset);
memset(p, 0, sizeof(*p));
int form = get_form(charset);
memset(p, 0, sizeof(*p));
z_ext_record2(o, charset);
}
p->recordsInSelectedCharSets = (bool_t *)odr_malloc(o, sizeof(bool_t));
z_ext_record2(o, charset);
}
p->recordsInSelectedCharSets = (bool_t *)odr_malloc(o, sizeof(bool_t));
if (!oid_oidcmp(pext->direct_reference, yaz_oid_negot_charset_3)
&& pext->which == Z_External_charSetandLanguageNegotiation)
{
if (!oid_oidcmp(pext->direct_reference, yaz_oid_negot_charset_3)
&& pext->which == Z_External_charSetandLanguageNegotiation)
{
Z_External *pext;
if (((*p)->list[i]->which == Z_OtherInfo_externallyDefinedInfo) &&
(pext = (*p)->list[i]->information.externallyDefinedInfo))
Z_External *pext;
if (((*p)->list[i]->which == Z_OtherInfo_externallyDefinedInfo) &&
(pext = (*p)->list[i]->information.externallyDefinedInfo))
{
(*charsets)[i] = 0;
if (pro->proposedCharSets[i]->which ==
Z_OriginProposal_0_private &&
pro->proposedCharSets[i]->u.zprivate->which ==
{
(*charsets)[i] = 0;
if (pro->proposedCharSets[i]->which ==
Z_OriginProposal_0_private &&
pro->proposedCharSets[i]->u.zprivate->which ==
(*charsets)[i] = (char *)
nmem_malloc(mem, (1+pext->u.octet_aligned->len) *
sizeof(char));
(*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);
- memcpy (*charset, pext->u.octet_aligned->buf,
- pext->u.octet_aligned->len);
+ memcpy(*charset, pext->u.octet_aligned->buf,
+ pext->u.octet_aligned->len);