X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ficu_I18N.c;h=d3f8a4ba36d552b55df205de3ef87147a4dae068;hb=ae309395bf5f5511c2eee751151a2962726f745a;hp=de8487418822a4420c99ea9f17044d4f77577c58;hpb=765b94caaa93566a9792019ec5d2bf56fc8100a3;p=yaz-moved-to-github.git diff --git a/src/icu_I18N.c b/src/icu_I18N.c index de84874..d3f8a4b 100644 --- a/src/icu_I18N.c +++ b/src/icu_I18N.c @@ -1,8 +1,11 @@ -/* - * 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 @@ -166,8 +169,7 @@ struct icu_buf_utf8 * icu_buf_utf8_resize(struct icu_buf_utf8 * buf8, else buf8->utf8 = (uint8_t *) xrealloc(buf8->utf8, sizeof(uint8_t) * capacity); - - icu_buf_utf8_clear(buf8); + buf8->utf8_cap = capacity; } else { @@ -181,23 +183,6 @@ struct icu_buf_utf8 * icu_buf_utf8_resize(struct icu_buf_utf8 * buf8, } -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) @@ -687,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': @@ -696,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;