1 /* $Id: icu_I18N.h,v 1.10 2007-05-11 09:35:50 marc Exp $
2 Copyright (c) 2006-2007, Index Data.
4 This file is part of Pazpar2.
6 Pazpar2 is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with Pazpar2; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
30 #include <unicode/utypes.h> /* Basic ICU data types */
31 #include <unicode/uchar.h> /* char names */
33 //#include <unicode/ustdio.h>
34 #include <unicode/ucol.h>
35 //#include <unicode/ucnv.h> /* C Converter API */
36 //#include <unicode/ustring.h> /* some more string fcns*/
37 //#include <unicode/uloc.h>
38 #include <unicode/ubrk.h>
39 //#include <unicode/unistr.h>
40 #include <unicode/utrans.h>
44 // forward declarations
45 //struct UBreakIterator;
50 // declared structs and functions
53 int icu_check_status (UErrorCode status);
62 struct icu_buf_utf16 * icu_buf_utf16_create(size_t capacity);
63 struct icu_buf_utf16 * icu_buf_utf16_resize(struct icu_buf_utf16 * buf16,
65 void icu_buf_utf16_destroy(struct icu_buf_utf16 * buf16);
76 struct icu_buf_utf8 * icu_buf_utf8_create(size_t capacity);
77 struct icu_buf_utf8 * icu_buf_utf8_resize(struct icu_buf_utf8 * buf8,
79 void icu_buf_utf8_destroy(struct icu_buf_utf8 * buf8);
82 UErrorCode icu_utf16_from_utf8(struct icu_buf_utf16 * dest16,
83 struct icu_buf_utf8 * src8,
86 UErrorCode icu_utf16_from_utf8_cstr(struct icu_buf_utf16 * dest16,
87 const char * src8cstr,
91 UErrorCode icu_utf16_to_utf8(struct icu_buf_utf8 * dest8,
92 struct icu_buf_utf16 * src16,
95 int icu_utf16_casemap(struct icu_buf_utf16 * dest16,
96 struct icu_buf_utf16 * src16,
97 const char *locale, char action,
100 UErrorCode icu_sortkey8_from_utf16(UCollator *coll,
101 struct icu_buf_utf8 * dest8,
102 struct icu_buf_utf16 * src16,
103 UErrorCode * status);
110 struct icu_buf_utf16 * buf16;
115 // keep always invariant
118 // <= buf16->utf16_len
120 // 0 <= token_id <= token_count
123 struct icu_tokenizer * icu_tokenizer_create(const char *locale, char action,
126 void icu_tokenizer_destroy(struct icu_tokenizer * tokenizer);
128 int icu_tokenizer_attach(struct icu_tokenizer * tokenizer,
129 struct icu_buf_utf16 * src16, UErrorCode *status);
131 int32_t icu_tokenizer_next_token(struct icu_tokenizer * tokenizer,
132 struct icu_buf_utf16 * tkn16,
135 int32_t icu_tokenizer_token_id(struct icu_tokenizer * tokenizer);
136 int32_t icu_tokenizer_token_start(struct icu_tokenizer * tokenizer);
137 int32_t icu_tokenizer_token_end(struct icu_tokenizer * tokenizer);
138 int32_t icu_tokenizer_token_length(struct icu_tokenizer * tokenizer);
139 int32_t icu_tokenizer_token_count(struct icu_tokenizer * tokenizer);
143 struct icu_normalizer
146 struct icu_buf_utf16 * rules16;
147 UParseError parse_error[256];
148 UTransliterator * trans;
151 struct icu_normalizer * icu_normalizer_create(const char *rules, char action,
155 void icu_normalizer_destroy(struct icu_normalizer * normalizer);
159 #endif // ICU_I18NL_H