1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2012 Index Data.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of Index Data nor the names of its contributors
13 * may be used to endorse or promote products derived from this
14 * software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 \brief Internal header for ICU utilities
31 These functions, while non-static, are considered unstable and internal
32 and may be renamed for each YAZ release.
38 #include <yaz/yconfig.h>
40 #include <unicode/utypes.h> /* Basic ICU data types */
41 #include <unicode/uchar.h> /* char names */
43 #include <unicode/ucol.h>
44 #include <unicode/ubrk.h>
48 /* declared structs and functions */
50 int icu_check_status (UErrorCode status);
59 struct icu_buf_utf16 * icu_buf_utf16_create(size_t capacity);
61 struct icu_buf_utf16 * icu_buf_utf16_clear(struct icu_buf_utf16 * buf16);
63 struct icu_buf_utf16 * icu_buf_utf16_resize(struct icu_buf_utf16 * buf16,
66 struct icu_buf_utf16 *icu_buf_utf16_copy(struct icu_buf_utf16 * dest16,
67 const struct icu_buf_utf16 * src16);
69 void icu_buf_utf16_destroy(struct icu_buf_utf16 * buf16);
80 struct icu_buf_utf8 * icu_buf_utf8_create(size_t capacity);
82 struct icu_buf_utf8 * icu_buf_utf8_clear(struct icu_buf_utf8 * buf8);
84 struct icu_buf_utf8 * icu_buf_utf8_resize(struct icu_buf_utf8 * buf8,
87 void icu_buf_utf8_destroy(struct icu_buf_utf8 * buf8);
90 UErrorCode icu_utf16_from_utf8_cstr(struct icu_buf_utf16 * dest16,
91 const char * src8cstr,
94 const char *icu_buf_utf8_to_cstr(struct icu_buf_utf8 *src8);
97 UErrorCode icu_utf16_to_utf8(struct icu_buf_utf8 *dest8,
98 const struct icu_buf_utf16 *src16,
103 struct icu_casemap * icu_casemap_create(char action, UErrorCode *status);
105 struct icu_casemap *icu_casemap_clone(struct icu_casemap *old);
107 void icu_casemap_destroy(struct icu_casemap * casemap);
109 int icu_casemap_casemap(struct icu_casemap * casemap,
110 struct icu_buf_utf16 * dest16,
111 struct icu_buf_utf16 * src16,
115 int icu_utf16_casemap(struct icu_buf_utf16 * dest16,
116 struct icu_buf_utf16 * src16,
117 const char *locale, char action,
120 void icu_sortkey8_from_utf16(UCollator *coll,
121 struct icu_buf_utf8 * dest8,
122 struct icu_buf_utf16 * src16,
123 UErrorCode * status);
125 struct icu_tokenizer;
126 struct icu_tokenizer * icu_tokenizer_create(const char *locale, char action,
129 struct icu_tokenizer *icu_tokenizer_clone(struct icu_tokenizer *old);
130 void icu_tokenizer_destroy(struct icu_tokenizer * tokenizer);
132 int icu_tokenizer_attach(struct icu_tokenizer * tokenizer,
133 struct icu_buf_utf16 * src16, UErrorCode *status);
135 int32_t icu_tokenizer_next_token(struct icu_tokenizer * tokenizer,
136 struct icu_buf_utf16 * tkn16,
139 int32_t icu_tokenizer_token_count(struct icu_tokenizer * tokenizer);
141 struct icu_transform;
143 struct icu_transform * icu_transform_create(const char *id, char action,
146 struct icu_transform *icu_transform_clone(struct icu_transform *old);
147 void icu_transform_destroy(struct icu_transform * transform);
149 int icu_transform_trans(struct icu_transform * transform,
150 struct icu_buf_utf16 * dest16,
151 const struct icu_buf_utf16 * src16,
154 struct icu_chain_step;
156 int icu_chain_token_number(yaz_icu_chain_t chain);
158 yaz_icu_chain_t icu_chain_create(const char * locale,
160 UErrorCode * status);
162 #endif /* ICU_I18NL_H */
167 * c-file-style: "Stroustrup"
168 * indent-tabs-mode: nil
170 * vim: shiftwidth=4 tabstop=8 expandtab