yaz-client. Each item must be separated by comma (NO BLANKS). E.g.
negcharset iso-8859-1,utf-8
Added az_set_proposal_charneg_list.
---- 2.1.16 2006/03/30
+--- 2.1.16 2006/03/31
+
+Allow multiple languages and charsets to be specified with
+yaz-client. Each item must be separated by comma (NO BLANKS). E.g.
+ negcharset iso-8859-1,utf-8
Translation of proximity nodes from CQL into PQF now works.
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.302 2005-12-20 23:07:27 adam Exp $
+ * $Id: client.c,v 1.303 2006-03-31 09:51:21 adam Exp $
*/
#include <stdio.h>
p0->which = Z_OtherInfo_externallyDefinedInfo;
p0->information.externallyDefinedInfo =
- yaz_set_proposal_charneg(
- out,
- (const char**)&negotiationCharset,
- negotiationCharset ? 1 : 0,
- (const char**)&yazLang, yazLang ? 1 : 0,
- negotiationCharsetRecords);
+ yaz_set_proposal_charneg_list(out, ",",
+ negotiationCharset,
+ yazLang,
+ negotiationCharsetRecords);
}
}
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
- * $Id: charneg.h,v 1.7 2005-06-25 15:46:01 adam Exp $
+ * $Id: charneg.h,v 1.8 2006-03-31 09:51:22 adam Exp $
*/
/**
* \file charneg.h
int num_langs, int selected);
YAZ_EXPORT
+Z_External *yaz_set_proposal_charneg_list(ODR o,
+ const char *delim,
+ const char *charset_list,
+ const char *lang_list,
+ int selected);
+
+YAZ_EXPORT
void yaz_get_response_charneg(NMEM mem,
Z_CharSetandLanguageNegotiation *p,
char **charset, char **lang,
char ***charsets, int *num_charsets,
char ***langs, int *num_langs,
int *selected);
+
+
YAZ_END_CDECL
#endif
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: charneg.c,v 1.5 2005-06-25 15:46:03 adam Exp $
+ * $Id: charneg.c,v 1.6 2006-03-31 09:51:22 adam Exp $
*/
/**
return p;
}
+Z_External *yaz_set_proposal_charneg_list(ODR o,
+ const char *delim,
+ const char *charset_list,
+ const char *lang_list,
+ int selected)
+{
+ char **charsets_addresses = 0;
+ char **langs_addresses = 0;
+ int charsets_count = 0;
+ int langs_count = 0;
+
+ if (charset_list)
+ nmem_strsplit(o->mem, delim, charset_list,
+ &charsets_addresses, &charsets_count);
+ if (lang_list)
+ nmem_strsplit(o->mem, delim, lang_list,
+ &langs_addresses, &langs_count);
+ return yaz_set_proposal_charneg(o,
+ (const char **) charsets_addresses,
+ charsets_count,
+ (const char **) langs_addresses,
+ langs_count,
+ selected);
+}
+
+
/* used by yaz_set_response_charneg */
static Z_TargetResponse *z_get_TargetResponse(ODR o, const char *charset,
const char *lang, int selected)
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zoom-c.c,v 1.65 2006-03-13 10:48:14 adam Exp $
+ * $Id: zoom-c.c,v 1.66 2006-03-31 09:51:22 adam Exp $
*/
/**
* \file zoom-c.c
ZOOM_options_get(c->options, "implementationName"),
odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName));
- version = odr_strdup(c->odr_out, "$Revision: 1.65 $");
+ version = odr_strdup(c->odr_out, "$Revision: 1.66 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
ireq->implementationVersion = odr_prepend(c->odr_out,
if ((oi_unit = yaz_oi_update(oi, c->odr_out, NULL, 0, 0)))
{
- char **charsets_addresses = 0;
- char **langs_addresses = 0;
- int charsets_count = 0;
- int langs_count = 0;
-
- if (c->charset)
- nmem_strsplit_blank(c->odr_out->mem, c->charset,
- &charsets_addresses, &charsets_count);
- if (c->lang)
- nmem_strsplit_blank(c->odr_out->mem, c->lang,
- &langs_addresses, &langs_count);
ODR_MASK_SET(ireq->options, Z_Options_negotiationModel);
oi_unit->which = Z_OtherInfo_externallyDefinedInfo;
oi_unit->information.externallyDefinedInfo =
- yaz_set_proposal_charneg(c->odr_out,
- (const char **) charsets_addresses,
- charsets_count,
- (const char **) langs_addresses,
- langs_count,
- 1);
+ yaz_set_proposal_charneg_list(c->odr_out, " ",
+ c->charset, c->lang, 1);
}
}
assert (apdu);