1 /* 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 29 #pragma once 30 31 #include <ctype.h> 32 #include <stdint.h> 33 #include <wchar.h> 34 35 enum UCharCategory { 36 U_NON_SPACING_MARK = 6, 37 U_ENCLOSING_MARK = 7, 38 U_DECIMAL_NUMBER = 9, 39 U_CONTROL_CHAR = 15, 40 U_FORMAT_CHAR = 16, 41 U_DASH_PUNCTUATION = 19, 42 U_OTHER_PUNCTUATION = 23, 43 }; 44 45 enum 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 54 enum 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 63 __BEGIN_DECLS 64 65 uint8_t __icu4x_bionic_general_category(uint32_t cp); 66 uint8_t __icu4x_bionic_east_asian_width(uint32_t cp); 67 uint8_t __icu4x_bionic_hangul_syllable_type(uint32_t cp); 68 69 bool __icu4x_bionic_is_alphabetic(uint32_t cp); 70 bool __icu4x_bionic_is_default_ignorable_code_point(uint32_t cp); 71 bool __icu4x_bionic_is_lowercase(uint32_t cp); 72 bool __icu4x_bionic_is_alnum(uint32_t cp); 73 bool __icu4x_bionic_is_blank(uint32_t cp); 74 bool __icu4x_bionic_is_graph(uint32_t cp); 75 bool __icu4x_bionic_is_print(uint32_t cp); 76 bool __icu4x_bionic_is_xdigit(uint32_t cp); 77 bool __icu4x_bionic_is_white_space(uint32_t cp); 78 bool __icu4x_bionic_is_uppercase(uint32_t cp); 79 80 uint32_t __icu4x_bionic_to_upper(uint32_t ch); 81 uint32_t __icu4x_bionic_to_lower(uint32_t ch); 82 83 __END_DECLS 84