X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ficu_I18N.c;h=2259b46be9dbeaf74c1debad51240d115337d953;hb=479969ddd4d243955f2e64ef8571926429ad4f37;hp=932c1b2d43ad8e9a384d478202d0a945329b2af2;hpb=c5408040f72a5a23dc23d6c8d30ee61ea8b6effc;p=yaz-moved-to-github.git diff --git a/src/icu_I18N.c b/src/icu_I18N.c index 932c1b2..2259b46 100644 --- a/src/icu_I18N.c +++ b/src/icu_I18N.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: icu_I18N.c,v 1.10 2007-10-29 13:50:57 marc Exp $ + * $Id: icu_I18N.c,v 1.13 2007-11-08 08:17:17 adam Exp $ */ #if HAVE_CONFIG_H @@ -15,7 +15,7 @@ #endif -#if HAVE_ICU +#if YAZ_HAVE_ICU #include #include @@ -267,6 +267,7 @@ UErrorCode icu_utf16_from_utf8_cstr(struct icu_buf_utf16 * dest16, size_t src8cstr_len = 0; int32_t utf16_len = 0; + *status = U_ZERO_ERROR; src8cstr_len = strlen(src8cstr); u_strFromUTF8(dest16->utf16, dest16->utf16_cap, @@ -850,7 +851,7 @@ void icu_chain_step_destroy(struct icu_chain_step * step){ -struct icu_chain * icu_chain_create(const uint8_t * locale, +struct icu_chain * icu_chain_create(const char *locale, int sort, UErrorCode * status) { @@ -858,6 +859,8 @@ struct icu_chain * icu_chain_create(const uint8_t * locale, struct icu_chain * chain = (struct icu_chain *) malloc(sizeof(struct icu_chain)); + *status = U_ZERO_ERROR; + strncpy((char *) chain->locale, (const char *) locale, 16); chain->locale[16 - 1] = '\0'; @@ -905,14 +908,16 @@ void icu_chain_destroy(struct icu_chain * chain) -struct icu_chain * icu_chain_xml_config(xmlNode *xml_node, - const uint8_t * locale, +struct icu_chain * icu_chain_xml_config(const xmlNode *xml_node, + const char *locale, int sort, UErrorCode * status){ xmlNode *node = 0; struct icu_chain * chain = 0; + *status = U_ZERO_ERROR; + if (!xml_node ||xml_node->type != XML_ELEMENT_NODE // || strcmp((const char *) xml_node->name, "icu_chain") @@ -1151,6 +1156,8 @@ int icu_chain_next_token(struct icu_chain * chain, { int got_token = 0; + *status = U_ZERO_ERROR; + if (!chain) return 0; @@ -1233,9 +1240,7 @@ const UCollator * icu_chain_get_coll(struct icu_chain * chain) } - - -#endif /* HAVE_ICU */ +#endif /* YAZ_HAVE_ICU */