X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Ficu_I18N.c;h=b2119b6804cf7ebeb5e999a2958d4e947fe2fb48;hp=0bbd01022ef500d91c7603d92f47ae78dd099a22;hb=68398183c3b25120b484681482f461a1da4c6a36;hpb=ee6ab2ee3a9ee1a8c65d7272ec7fba1d886f5af0 diff --git a/src/icu_I18N.c b/src/icu_I18N.c index 0bbd010..b2119b6 100644 --- a/src/icu_I18N.c +++ b/src/icu_I18N.c @@ -3,6 +3,11 @@ * See the file LICENSE for details. */ +/** + * \file icu_I18N.c + * \brief ICU utilities + */ + #if HAVE_CONFIG_H #include "config.h" #endif @@ -667,7 +672,7 @@ struct icu_normalizer * icu_normalizer_create(const char *rules, char action, normalizer->rules16->utf16_len, UTRANS_FORWARD, 0, 0, - normalizer->parse_error, status); + &normalizer->parse_error, status); break; case 'r': case 'R': @@ -676,7 +681,7 @@ struct icu_normalizer * icu_normalizer_create(const char *rules, char action, normalizer->rules16->utf16_len, UTRANS_REVERSE , 0, 0, - normalizer->parse_error, status); + &normalizer->parse_error, status); break; default: *status = U_UNSUPPORTED_ERROR; @@ -909,14 +914,31 @@ struct icu_chain * icu_chain_xml_config(const xmlNode *xml_node, else if (!strcmp((const char *) node->name, "display")) step = icu_chain_insert_step(chain, ICU_chain_step_type_display, (const uint8_t *) "", status); + else if (!strcmp((const char *) node->name, "normalize")) + { + yaz_log(YLOG_WARN, "Element %s is deprecated. " + "Use transform instead", node->name); + step = icu_chain_insert_step(chain, ICU_chain_step_type_normalize, + (const uint8_t *) xml_rule, status); + } + else if (!strcmp((const char *) node->name, "index") + || !strcmp((const char *) node->name, "sortkey")) + { + yaz_log(YLOG_WARN, "Element %s is no longer needed. " + "Remove it from the configuration", node->name); + } + else + { + yaz_log(YLOG_WARN, "Unknown element %s", node->name); + icu_chain_destroy(chain); + return 0; + } xmlFree(xml_rule); - if (!step || U_FAILURE(*status)) + if (step && U_FAILURE(*status)) { icu_chain_destroy(chain); return 0; } - - } return chain; }