blob: 8b7e1d007bc5bee31bb93d49925e9a60112308a7 [file] [log] [blame]
Elliott Hughesa57ca0d2016-11-17 18:18:08 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
13 * distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
Manish Goregaokar361854c2025-03-05 15:02:28 -080029#pragma once
Elliott Hughesa57ca0d2016-11-17 18:18:08 -080030
Manish Goregaokar361854c2025-03-05 15:02:28 -080031#include <ctype.h>
Elliott Hughes722d01a2016-12-08 15:16:37 -080032#include <stdint.h>
Elliott Hughesc41b5602017-07-27 17:08:08 -070033#include <wchar.h>
Elliott Hughes722d01a2016-12-08 15:16:37 -080034
Elliott Hughes722d01a2016-12-08 15:16:37 -080035enum UCharCategory {
Elliott Hughesc41b5602017-07-27 17:08:08 -070036 U_NON_SPACING_MARK = 6,
37 U_ENCLOSING_MARK = 7,
Manish Goregaokar361854c2025-03-05 15:02:28 -080038 U_DECIMAL_NUMBER = 9,
Elliott Hughes722d01a2016-12-08 15:16:37 -080039 U_CONTROL_CHAR = 15,
Elliott Hughesc41b5602017-07-27 17:08:08 -070040 U_FORMAT_CHAR = 16,
Manish Goregaokar361854c2025-03-05 15:02:28 -080041 U_DASH_PUNCTUATION = 19,
42 U_OTHER_PUNCTUATION = 23,
Elliott Hughes722d01a2016-12-08 15:16:37 -080043};
44
Elliott Hughesc41b5602017-07-27 17:08:08 -070045enum UEastAsianWidth {
46 U_EA_NEUTRAL,
47 U_EA_AMBIGUOUS,
48 U_EA_HALFWIDTH,
49 U_EA_FULLWIDTH,
50 U_EA_NARROW,
51 U_EA_WIDE,
52};
53
54enum UHangulSyllableType {
55 U_HST_NOT_APPLICABLE,
56 U_HST_LEADING_JAMO,
57 U_HST_VOWEL_JAMO,
58 U_HST_TRAILING_JAMO,
59 U_HST_LV_SYLLABLE,
60 U_HST_LVT_SYLLABLE,
61};
62
Manish Goregaokar361854c2025-03-05 15:02:28 -080063__BEGIN_DECLS
Elliott Hughes8f07d342024-08-21 23:56:24 +000064
Manish Goregaokar361854c2025-03-05 15:02:28 -080065uint8_t __icu4x_bionic_general_category(uint32_t cp);
66uint8_t __icu4x_bionic_east_asian_width(uint32_t cp);
67uint8_t __icu4x_bionic_hangul_syllable_type(uint32_t cp);
Elliott Hughesc41b5602017-07-27 17:08:08 -070068
Manish Goregaokar361854c2025-03-05 15:02:28 -080069bool __icu4x_bionic_is_alphabetic(uint32_t cp);
70bool __icu4x_bionic_is_default_ignorable_code_point(uint32_t cp);
71bool __icu4x_bionic_is_lowercase(uint32_t cp);
72bool __icu4x_bionic_is_alnum(uint32_t cp);
73bool __icu4x_bionic_is_blank(uint32_t cp);
74bool __icu4x_bionic_is_graph(uint32_t cp);
75bool __icu4x_bionic_is_print(uint32_t cp);
76bool __icu4x_bionic_is_xdigit(uint32_t cp);
77bool __icu4x_bionic_is_white_space(uint32_t cp);
78bool __icu4x_bionic_is_uppercase(uint32_t cp);
Elliott Hughesa57ca0d2016-11-17 18:18:08 -080079
Manish Goregaokar361854c2025-03-05 15:02:28 -080080uint32_t __icu4x_bionic_to_upper(uint32_t ch);
81uint32_t __icu4x_bionic_to_lower(uint32_t ch);
82
83__END_DECLS