-/*
- * Copyright (C) 1995-2007, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2008 Index Data
* See the file LICENSE for details.
- *
- * $Id: icu_I18N.c,v 1.21 2007-11-30 11:43:47 adam Exp $
+ */
+
+/**
+ * \file icu_I18N.c
+ * \brief ICU utilities
*/
#if HAVE_CONFIG_H
else
buf8->utf8
= (uint8_t *) xrealloc(buf8->utf8, sizeof(uint8_t) * capacity);
-
- icu_buf_utf8_clear(buf8);
+
buf8->utf8_cap = capacity;
}
else {
}
-struct icu_buf_utf8 * icu_buf_utf8_copy(struct icu_buf_utf8 * dest8,
- struct icu_buf_utf8 * src8)
-{
- if(!dest8 || !src8
- || dest8 == src8)
- return 0;
-
-
- if (dest8->utf8_cap < src8->utf8_len)
- icu_buf_utf8_resize(dest8, src8->utf8_len * 2);
-
- strncpy((char*) dest8->utf8, (char*) src8->utf8, src8->utf8_len);
-
- return dest8;
-}
-
-
const char *icu_buf_utf8_to_cstr(struct icu_buf_utf8 *src8)
{
if (!src8 || src8->utf8_len == 0)
normalizer->rules16->utf16_len,
UTRANS_FORWARD,
0, 0,
- normalizer->parse_error, status);
+ &normalizer->parse_error, status);
break;
case 'r':
case 'R':
normalizer->rules16->utf16_len,
UTRANS_REVERSE ,
0, 0,
- normalizer->parse_error, status);
+ &normalizer->parse_error, status);
break;
default:
*status = U_UNSUPPORTED_ERROR;
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;
}