u 0.5.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/build/ext/u/data/attributes.rb +39 -0
- data/build/ext/u/data/bidi-mirroring.rb +27 -0
- data/build/ext/u/data/canonical-combining-class.rb +15 -0
- data/build/ext/u/data/case-folding.rb +39 -0
- data/build/ext/u/data/cased.rb +19 -0
- data/build/ext/u/data/compose.rb +304 -0
- data/build/ext/u/data/constants.rb +31 -0
- data/build/ext/u/data/decompose.rb +85 -0
- data/build/ext/u/data/general-category.rb +61 -0
- data/build/ext/u/data/grapheme-word-break.rb +15 -0
- data/build/ext/u/data/marshalled.rb +5 -0
- data/build/ext/u/data/script.rb +91 -0
- data/build/ext/u/data/soft-dotted.rb +17 -0
- data/build/ext/u/data/title-table.rb +30 -0
- data/build/ext/u/data/wide.rb +17 -0
- data/build/lib/u/build.rb +8 -0
- data/build/lib/u/build/data.rb +16 -0
- data/build/lib/u/build/data/bidimirroring.rb +26 -0
- data/build/lib/u/build/data/break.rb +14 -0
- data/build/lib/u/build/data/casefolding.rb +77 -0
- data/build/lib/u/build/data/compositionexclusions.rb +14 -0
- data/build/lib/u/build/data/derivedeastasianwidth.rb +15 -0
- data/build/lib/u/build/data/file.rb +88 -0
- data/build/lib/u/build/data/linebreak.rb +14 -0
- data/build/lib/u/build/data/proplist.rb +18 -0
- data/build/lib/u/build/data/scripts.rb +22 -0
- data/build/lib/u/build/data/specialcasing.rb +106 -0
- data/build/lib/u/build/data/unicode.rb +41 -0
- data/build/lib/u/build/data/unicode/entry.rb +27 -0
- data/build/lib/u/build/data/unicode/entry/decomposition.rb +29 -0
- data/build/lib/u/build/data/unicode/points.rb +32 -0
- data/build/lib/u/build/header.rb +11 -0
- data/build/lib/u/build/header/table.rb +19 -0
- data/build/lib/u/build/header/table/row.rb +64 -0
- data/build/lib/u/build/header/tables.rb +6 -0
- data/build/lib/u/build/header/tables/intervals.rb +50 -0
- data/build/lib/u/build/header/tables/split.rb +20 -0
- data/build/lib/u/build/header/tables/split/data.rb +29 -0
- data/build/lib/u/build/header/tables/split/part1.rb +28 -0
- data/build/lib/u/build/header/tables/split/part2.rb +13 -0
- data/build/lib/u/build/header/tables/split/row.rb +34 -0
- data/build/lib/u/build/header/tables/split/rows.rb +22 -0
- data/build/test/unit/break.rb +45 -0
- data/build/test/unit/case.rb +178 -0
- data/build/test/unit/foldcase.rb +44 -0
- data/build/test/unit/normalize.rb +81 -0
- data/ext/u/attributes.c +62 -0
- data/ext/u/attributes.h +5 -0
- data/ext/u/case.h +41 -0
- data/ext/u/data/attributes.h +3070 -0
- data/ext/u/data/bidi-mirroring.h +373 -0
- data/ext/u/data/canonical-combining-class.h +2157 -0
- data/ext/u/data/case-folding.h +171 -0
- data/ext/u/data/cased.h +42 -0
- data/ext/u/data/compose.h +1714 -0
- data/ext/u/data/constants.h +17 -0
- data/ext/u/data/decompose.h +9356 -0
- data/ext/u/data/general-category.h +28959 -0
- data/ext/u/data/grapheme-break.h +13201 -0
- data/ext/u/data/line-break.h +26501 -0
- data/ext/u/data/normalization-quick-check.h +3002 -0
- data/ext/u/data/script.h +2928 -0
- data/ext/u/data/soft-dotted.h +55 -0
- data/ext/u/data/title-table.h +41 -0
- data/ext/u/data/types.h +11117 -0
- data/ext/u/data/wide-cjk.h +197 -0
- data/ext/u/data/wide.h +59 -0
- data/ext/u/data/word-break.h +10001 -0
- data/ext/u/depend +281 -0
- data/ext/u/extconf.rb +158 -0
- data/ext/u/output.h +51 -0
- data/ext/{encoding/character/utf-8 → u}/private.c +11 -15
- data/ext/u/private.h +58 -0
- data/ext/u/rb_includes.h +10 -0
- data/ext/u/rb_private.c +98 -0
- data/ext/u/rb_private.h +67 -0
- data/ext/u/rb_u.c +251 -0
- data/ext/u/rb_u_buffer.c +443 -0
- data/ext/u/rb_u_buffer.h +24 -0
- data/ext/u/rb_u_re.c +43 -0
- data/ext/u/rb_u_re.h +15 -0
- data/ext/u/rb_u_string.c +478 -0
- data/ext/u/rb_u_string.h +173 -0
- data/ext/u/rb_u_string_alnum.c +10 -0
- data/ext/u/rb_u_string_alpha.c +10 -0
- data/ext/u/rb_u_string_aref.c +142 -0
- data/ext/u/rb_u_string_ascii_only.c +13 -0
- data/ext/u/rb_u_string_assigned.c +10 -0
- data/ext/u/rb_u_string_b.c +18 -0
- data/ext/u/rb_u_string_bytesize.c +10 -0
- data/ext/u/rb_u_string_byteslice.c +103 -0
- data/ext/u/rb_u_string_canonical_combining_class.c +33 -0
- data/ext/u/rb_u_string_case_ignorable.c +25 -0
- data/ext/u/rb_u_string_casecmp.c +61 -0
- data/ext/u/rb_u_string_cased.c +17 -0
- data/ext/u/rb_u_string_chomp.c +107 -0
- data/ext/u/rb_u_string_chop.c +33 -0
- data/ext/u/rb_u_string_chr.c +9 -0
- data/ext/u/rb_u_string_cntrl.c +10 -0
- data/ext/u/rb_u_string_collate.c +46 -0
- data/ext/u/rb_u_string_collation_key.c +18 -0
- data/ext/u/rb_u_string_count.c +38 -0
- data/ext/u/rb_u_string_defined.c +10 -0
- data/ext/u/rb_u_string_delete.c +62 -0
- data/ext/u/rb_u_string_digit.c +10 -0
- data/ext/u/rb_u_string_downcase.c +13 -0
- data/ext/u/rb_u_string_dump.c +153 -0
- data/ext/u/rb_u_string_each_byte.c +46 -0
- data/ext/u/rb_u_string_each_char.c +49 -0
- data/ext/u/rb_u_string_each_codepoint.c +45 -0
- data/ext/u/rb_u_string_each_grapheme_cluster.c +36 -0
- data/ext/u/rb_u_string_each_line.c +142 -0
- data/ext/u/rb_u_string_each_word.c +34 -0
- data/ext/u/rb_u_string_empty.c +11 -0
- data/ext/u/rb_u_string_end_with.c +31 -0
- data/ext/u/rb_u_string_eql.c +30 -0
- data/ext/u/rb_u_string_equal.c +33 -0
- data/ext/u/rb_u_string_foldcase.c +12 -0
- data/ext/u/rb_u_string_folded.c +13 -0
- data/ext/u/rb_u_string_format.c +1745 -0
- data/ext/u/rb_u_string_general_category.c +109 -0
- data/ext/u/rb_u_string_getbyte.c +21 -0
- data/ext/u/rb_u_string_graph.c +21 -0
- data/ext/u/rb_u_string_grapheme_break.c +61 -0
- data/ext/u/rb_u_string_gsub.c +164 -0
- data/ext/u/rb_u_string_hash.c +10 -0
- data/ext/u/rb_u_string_hex.c +9 -0
- data/ext/u/rb_u_string_include.c +10 -0
- data/ext/u/rb_u_string_index.c +110 -0
- data/ext/u/rb_u_string_inspect.c +189 -0
- data/ext/u/rb_u_string_internal_tr.c +148 -0
- data/ext/u/rb_u_string_internal_tr.h +29 -0
- data/ext/u/rb_u_string_justify.c +169 -0
- data/ext/u/rb_u_string_length.c +10 -0
- data/ext/u/rb_u_string_line_break.c +115 -0
- data/ext/u/rb_u_string_lower.c +13 -0
- data/ext/u/rb_u_string_lstrip.c +24 -0
- data/ext/u/rb_u_string_match.c +65 -0
- data/ext/u/rb_u_string_mirror.c +16 -0
- data/ext/u/rb_u_string_newline.c +21 -0
- data/ext/u/rb_u_string_normalize.c +70 -0
- data/ext/u/rb_u_string_normalized.c +28 -0
- data/ext/u/rb_u_string_oct.c +11 -0
- data/ext/u/rb_u_string_ord.c +14 -0
- data/ext/u/rb_u_string_partition.c +80 -0
- data/ext/u/rb_u_string_plus.c +33 -0
- data/ext/u/rb_u_string_print.c +10 -0
- data/ext/u/rb_u_string_punct.c +10 -0
- data/ext/u/rb_u_string_reverse.c +13 -0
- data/ext/u/rb_u_string_rindex.c +104 -0
- data/ext/u/rb_u_string_rpartition.c +81 -0
- data/ext/u/rb_u_string_rstrip.c +29 -0
- data/ext/u/rb_u_string_scan.c +109 -0
- data/ext/u/rb_u_string_script.c +253 -0
- data/ext/u/rb_u_string_soft_dotted.c +13 -0
- data/ext/u/rb_u_string_space.c +24 -0
- data/ext/u/rb_u_string_split.c +245 -0
- data/ext/u/rb_u_string_squeeze.c +75 -0
- data/ext/u/rb_u_string_start_with.c +31 -0
- data/ext/u/rb_u_string_strip.c +36 -0
- data/ext/u/rb_u_string_sub.c +147 -0
- data/ext/u/rb_u_string_times.c +35 -0
- data/ext/u/rb_u_string_title.c +10 -0
- data/ext/u/rb_u_string_titlecase.c +13 -0
- data/ext/u/rb_u_string_to_i.c +45 -0
- data/ext/u/rb_u_string_to_inum.c +364 -0
- data/ext/u/rb_u_string_to_inum.h +1 -0
- data/ext/u/rb_u_string_to_str.c +17 -0
- data/ext/u/rb_u_string_to_sym.c +12 -0
- data/ext/u/rb_u_string_tr.c +290 -0
- data/ext/u/rb_u_string_upcase.c +12 -0
- data/ext/u/rb_u_string_upper.c +13 -0
- data/ext/u/rb_u_string_valid.c +10 -0
- data/ext/u/rb_u_string_valid_encoding.c +12 -0
- data/ext/u/rb_u_string_wide.c +21 -0
- data/ext/u/rb_u_string_wide_cjk.c +21 -0
- data/ext/u/rb_u_string_width.c +19 -0
- data/ext/u/rb_u_string_word_break.c +63 -0
- data/ext/u/rb_u_string_xdigit.c +22 -0
- data/ext/u/rb_u_string_zero_width.c +16 -0
- data/ext/u/titled.c +55 -0
- data/ext/u/titled.h +1 -0
- data/ext/u/u.c +23 -0
- data/ext/u/u.h +458 -0
- data/ext/u/u_char_canonical_combining_class.c +31 -0
- data/ext/u/u_char_digit_value.c +21 -0
- data/ext/u/u_char_downcase.c +27 -0
- data/ext/u/u_char_general_category.c +31 -0
- data/ext/u/u_char_grapheme_break.c +28 -0
- data/ext/u/u_char_isalnum.c +24 -0
- data/ext/u/u_char_isalpha.c +21 -0
- data/ext/u/u_char_isassigned.c +16 -0
- data/ext/u/u_char_iscased.c +22 -0
- data/ext/u/u_char_iscaseignorable.c +29 -0
- data/ext/u/u_char_iscntrl.c +17 -0
- data/ext/u/u_char_isdefined.c +15 -0
- data/ext/u/u_char_isdigit.c +16 -0
- data/ext/u/u_char_isgraph.c +22 -0
- data/ext/u/u_char_islower.c +16 -0
- data/ext/u/u_char_isnewline.c +24 -0
- data/ext/u/u_char_isprint.c +21 -0
- data/ext/u/u_char_ispunct.c +27 -0
- data/ext/u/u_char_issoftdotted.c +18 -0
- data/ext/u/u_char_isspace.c +28 -0
- data/ext/u/u_char_isupper.c +16 -0
- data/ext/u/u_char_isvalid.c +18 -0
- data/ext/u/u_char_iswide.c +18 -0
- data/ext/u/u_char_iswide_cjk.c +22 -0
- data/ext/u/u_char_isxdigit.c +27 -0
- data/ext/u/u_char_iszerowidth.c +29 -0
- data/ext/u/u_char_line_break.c +29 -0
- data/ext/u/u_char_mirror.c +16 -0
- data/ext/u/u_char_normalized.c +23 -0
- data/ext/u/u_char_script.c +41 -0
- data/ext/u/u_char_to_u.c +48 -0
- data/ext/u/u_char_upcase.c +24 -0
- data/ext/u/u_char_width.c +12 -0
- data/ext/u/u_char_word_break.c +28 -0
- data/ext/u/u_char_xdigit_value.c +31 -0
- data/ext/u/u_collate.c +83 -0
- data/ext/u/u_collation_key.c +132 -0
- data/ext/u/u_decode.c +156 -0
- data/ext/u/u_downcase.c +201 -0
- data/ext/u/u_foldcase.c +68 -0
- data/ext/u/u_grapheme_clusters.c +57 -0
- data/ext/u/u_has_prefix.c +27 -0
- data/ext/u/u_index.c +93 -0
- data/ext/u/u_is_ascii_only.c +33 -0
- data/ext/u/u_locale.c +40 -0
- data/ext/u/u_locale.h +14 -0
- data/ext/u/u_mirror.c +20 -0
- data/ext/u/u_n_bytes.c +16 -0
- data/ext/u/u_n_chars.c +43 -0
- data/ext/u/u_normalize.c +232 -0
- data/ext/u/u_normalized.c +28 -0
- data/ext/u/u_offset_to_pointer.c +62 -0
- data/ext/u/u_pointer_to_offset.c +23 -0
- data/ext/u/u_recode.c +73 -0
- data/ext/u/u_reverse.c +21 -0
- data/ext/u/u_rindex.c +132 -0
- data/ext/u/u_titlecase.c +68 -0
- data/ext/u/u_upcase.c +89 -0
- data/ext/u/u_width.c +35 -0
- data/ext/u/u_words.c +82 -0
- data/ext/u/yield.h +27 -0
- data/lib/u-1.0.rb +20 -0
- data/lib/u-1.0/buffer.rb +10 -0
- data/lib/u-1.0/string.rb +9 -0
- data/lib/u-1.0/version.rb +287 -0
- data/test/unit/case.rb +2080 -0
- data/test/unit/foldcase.rb +1136 -0
- data/test/unit/graphemebreak.rb +407 -0
- data/test/unit/normalize.rb +367545 -0
- data/test/unit/u-1.0.rb +10 -0
- data/test/unit/u-1.0/buffer.rb +52 -0
- data/test/unit/u-1.0/string.rb +1439 -0
- data/test/unit/{u.rb → u-1.0/version.rb} +0 -1
- data/test/unit/wordbreak.rb +1083 -0
- metadata +603 -148
- data/README +0 -38
- data/Rakefile +0 -64
- data/ext/encoding/character/utf-8/break.c +0 -25
- data/ext/encoding/character/utf-8/data/break.h +0 -22931
- data/ext/encoding/character/utf-8/data/character-tables.h +0 -14358
- data/ext/encoding/character/utf-8/data/compose.h +0 -1607
- data/ext/encoding/character/utf-8/data/decompose.h +0 -10926
- data/ext/encoding/character/utf-8/data/generate-unicode-data.rb +0 -1070
- data/ext/encoding/character/utf-8/decompose.c +0 -444
- data/ext/encoding/character/utf-8/depend +0 -65
- data/ext/encoding/character/utf-8/extconf.rb +0 -67
- data/ext/encoding/character/utf-8/private.h +0 -51
- data/ext/encoding/character/utf-8/properties.c +0 -1056
- data/ext/encoding/character/utf-8/rb_includes.h +0 -19
- data/ext/encoding/character/utf-8/rb_methods.h +0 -49
- data/ext/encoding/character/utf-8/rb_private.h +0 -52
- data/ext/encoding/character/utf-8/rb_utf_aref.c +0 -111
- data/ext/encoding/character/utf-8/rb_utf_aset.c +0 -105
- data/ext/encoding/character/utf-8/rb_utf_casecmp.c +0 -24
- data/ext/encoding/character/utf-8/rb_utf_chomp.c +0 -114
- data/ext/encoding/character/utf-8/rb_utf_chop.c +0 -44
- data/ext/encoding/character/utf-8/rb_utf_collate.c +0 -13
- data/ext/encoding/character/utf-8/rb_utf_count.c +0 -30
- data/ext/encoding/character/utf-8/rb_utf_delete.c +0 -60
- data/ext/encoding/character/utf-8/rb_utf_downcase.c +0 -13
- data/ext/encoding/character/utf-8/rb_utf_each_char.c +0 -27
- data/ext/encoding/character/utf-8/rb_utf_foldcase.c +0 -13
- data/ext/encoding/character/utf-8/rb_utf_hex.c +0 -14
- data/ext/encoding/character/utf-8/rb_utf_index.c +0 -50
- data/ext/encoding/character/utf-8/rb_utf_insert.c +0 -48
- data/ext/encoding/character/utf-8/rb_utf_internal_bignum.c +0 -332
- data/ext/encoding/character/utf-8/rb_utf_internal_bignum.h +0 -12
- data/ext/encoding/character/utf-8/rb_utf_internal_tr.c +0 -142
- data/ext/encoding/character/utf-8/rb_utf_internal_tr.h +0 -41
- data/ext/encoding/character/utf-8/rb_utf_justify.c +0 -96
- data/ext/encoding/character/utf-8/rb_utf_length.c +0 -14
- data/ext/encoding/character/utf-8/rb_utf_lstrip.c +0 -41
- data/ext/encoding/character/utf-8/rb_utf_normalize.c +0 -51
- data/ext/encoding/character/utf-8/rb_utf_oct.c +0 -14
- data/ext/encoding/character/utf-8/rb_utf_reverse.c +0 -13
- data/ext/encoding/character/utf-8/rb_utf_rindex.c +0 -88
- data/ext/encoding/character/utf-8/rb_utf_rstrip.c +0 -51
- data/ext/encoding/character/utf-8/rb_utf_squeeze.c +0 -70
- data/ext/encoding/character/utf-8/rb_utf_strip.c +0 -27
- data/ext/encoding/character/utf-8/rb_utf_to_i.c +0 -25
- data/ext/encoding/character/utf-8/rb_utf_tr.c +0 -250
- data/ext/encoding/character/utf-8/rb_utf_upcase.c +0 -13
- data/ext/encoding/character/utf-8/tables.h +0 -38
- data/ext/encoding/character/utf-8/unicode.c +0 -319
- data/ext/encoding/character/utf-8/unicode.h +0 -216
- data/ext/encoding/character/utf-8/utf.c +0 -1334
- data/lib/encoding/character/utf-8.rb +0 -201
- data/lib/u.rb +0 -16
- data/lib/u/string.rb +0 -185
- data/lib/u/version.rb +0 -5
- data/test/unit/u/string.rb +0 -91
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#include "rb_includes.h"
|
|
2
|
+
|
|
3
|
+
/* @overload xdigit?
|
|
4
|
+
*
|
|
5
|
+
* Returns true if the receiver contains only characters in the general
|
|
6
|
+
* category Number, decimal digit (Nd) or is a lower- or uppercase letter
|
|
7
|
+
* between ‘a’ and ‘f’. Specifically, any character that
|
|
8
|
+
*
|
|
9
|
+
* * Belongs to the general category Number, decimal digit (Nd)
|
|
10
|
+
* * Falls in the range U+0041 (LATIN CAPITAL LETTER A) through U+0046 (LATIN CAPITAL LETTER F)
|
|
11
|
+
* * Falls in the range U+0061 (LATIN SMALL LETTER A) through U+0066 (LATIN SMALL LETTER F)
|
|
12
|
+
* * Falls in the range U+FF21 (FULLWIDTH LATIN CAPITAL LETTER A) through U+FF26 (FULLWIDTH LATIN CAPITAL LETTER F)
|
|
13
|
+
* * Falls in the range U+FF41 (FULLWIDTH LATIN SMALL LETTER A) through U+FF46 (FULLWIDTH LATIN SMALL LETTER F)
|
|
14
|
+
*
|
|
15
|
+
* will do.
|
|
16
|
+
*
|
|
17
|
+
* @return [Boolean] */
|
|
18
|
+
VALUE
|
|
19
|
+
rb_u_string_xdigit(VALUE self)
|
|
20
|
+
{
|
|
21
|
+
return _rb_u_character_test(self, u_char_isxdigit);
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#include "rb_includes.h"
|
|
2
|
+
|
|
3
|
+
/* @overload zero_width?
|
|
4
|
+
*
|
|
5
|
+
* Returns true if the receiver contains only “zero-width” characters. A
|
|
6
|
+
* zero-width character is defined as a character in the general categories
|
|
7
|
+
* Mark, nonspacing (Mn), Mark, enclosing (Me) or Other, format (Of),
|
|
8
|
+
* excluding the character U+00AD (SOFT HYPHEN), or is a Hangul character
|
|
9
|
+
* between U+1160 and U+1200 or U+200B (ZERO WIDTH SPACE).
|
|
10
|
+
*
|
|
11
|
+
* @return [Boolean] */
|
|
12
|
+
VALUE
|
|
13
|
+
rb_u_string_zero_width(VALUE self)
|
|
14
|
+
{
|
|
15
|
+
return _rb_u_character_test(self, u_char_iszerowidth);
|
|
16
|
+
}
|
data/ext/u/titled.c
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#include <stdbool.h>
|
|
2
|
+
#include <stddef.h>
|
|
3
|
+
#include <stdint.h>
|
|
4
|
+
|
|
5
|
+
#include "u.h"
|
|
6
|
+
#include "private.h"
|
|
7
|
+
|
|
8
|
+
#include "data/constants.h"
|
|
9
|
+
#include "data/title-table.h"
|
|
10
|
+
|
|
11
|
+
#include "titled.h"
|
|
12
|
+
|
|
13
|
+
/* {{{1
|
|
14
|
+
* Determine whether ‘c’ is a titlecase letter, such as the slavic digraph DZ,
|
|
15
|
+
* which at the beginning of a word is written as Dz, where only the initial D
|
|
16
|
+
* is capitalized. (Complicated huh?)
|
|
17
|
+
*/
|
|
18
|
+
bool
|
|
19
|
+
u_char_istitle(uint32_t c)
|
|
20
|
+
{
|
|
21
|
+
size_t index;
|
|
22
|
+
|
|
23
|
+
return unicode_table_lookup(title_table, c, &index);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/* {{{1
|
|
28
|
+
* Convert ‘c’ to its titlecase representation (if any).
|
|
29
|
+
*/
|
|
30
|
+
uint32_t
|
|
31
|
+
u_char_titlecase(uint32_t c)
|
|
32
|
+
{
|
|
33
|
+
for (size_t i = 0; i < lengthof(title_table); i++)
|
|
34
|
+
if (title_table[i].ch == c ||
|
|
35
|
+
title_table[i].upper == c ||
|
|
36
|
+
title_table[i].lower == c)
|
|
37
|
+
return title_table[i].ch;
|
|
38
|
+
|
|
39
|
+
if (u_char_general_category(c) == U_GENERAL_CATEGORY_LETTER_LOWERCASE)
|
|
40
|
+
return u_char_upcase(c);
|
|
41
|
+
|
|
42
|
+
return c;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
uint32_t
|
|
47
|
+
_u_titlecase_table_lookup(uint32_t c, bool want_upper)
|
|
48
|
+
{
|
|
49
|
+
size_t index;
|
|
50
|
+
|
|
51
|
+
if (!unicode_table_lookup(title_table, c, &index))
|
|
52
|
+
return c;
|
|
53
|
+
|
|
54
|
+
return want_upper ? title_table[index].upper : title_table[index].lower;
|
|
55
|
+
}
|
data/ext/u/titled.h
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
U_CONST uint32_t _u_titlecase_table_lookup(uint32_t c, bool want_upper);
|
data/ext/u/u.c
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#include <stddef.h>
|
|
2
|
+
#include <stdint.h>
|
|
3
|
+
#include <stdbool.h>
|
|
4
|
+
|
|
5
|
+
#include "u.h"
|
|
6
|
+
|
|
7
|
+
/* {{{1
|
|
8
|
+
* s_utf_skip_lengths: This table is used for keeping track of how long a given
|
|
9
|
+
* UTF-8 character sequence is from the contents of the first byte.
|
|
10
|
+
*/
|
|
11
|
+
static const uint8_t s_u_skip_length_data[256] = {
|
|
12
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
13
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
14
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
15
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
16
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
17
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
18
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
19
|
+
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
const char * const u_skip_lengths = (const char *)s_u_skip_length_data;
|
data/ext/u/u.h
ADDED
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
|
2
|
+
# define U_CONST __attribute__((__const__))
|
|
3
|
+
#else
|
|
4
|
+
# define U_CONST
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 96)
|
|
8
|
+
# define U_PURE __attribute__((__pure__))
|
|
9
|
+
#else
|
|
10
|
+
# define U_PURE
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 2)
|
|
14
|
+
# define U_NON_NULL(parameters) __attribute__((__nonnull__ parameters))
|
|
15
|
+
#else
|
|
16
|
+
# define U_NON_NULL(parameters)
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
#define U_CHAR_MAX_BYTE_LENGTH 4
|
|
20
|
+
|
|
21
|
+
#define U_N_CODEPOINTS (0x10ffff + 1)
|
|
22
|
+
|
|
23
|
+
enum u_general_category {
|
|
24
|
+
U_GENERAL_CATEGORY_OTHER_CONTROL,
|
|
25
|
+
U_GENERAL_CATEGORY_OTHER_FORMAT,
|
|
26
|
+
U_GENERAL_CATEGORY_OTHER_NOT_ASSIGNED,
|
|
27
|
+
U_GENERAL_CATEGORY_OTHER_PRIVATE_USE,
|
|
28
|
+
U_GENERAL_CATEGORY_OTHER_SURROGATE,
|
|
29
|
+
U_GENERAL_CATEGORY_LETTER_LOWERCASE,
|
|
30
|
+
U_GENERAL_CATEGORY_LETTER_MODIFIER,
|
|
31
|
+
U_GENERAL_CATEGORY_LETTER_OTHER,
|
|
32
|
+
U_GENERAL_CATEGORY_LETTER_TITLECASE,
|
|
33
|
+
U_GENERAL_CATEGORY_LETTER_UPPERCASE,
|
|
34
|
+
U_GENERAL_CATEGORY_MARK_SPACING_COMBINING,
|
|
35
|
+
U_GENERAL_CATEGORY_MARK_ENCLOSING,
|
|
36
|
+
U_GENERAL_CATEGORY_MARK_NON_SPACING,
|
|
37
|
+
U_GENERAL_CATEGORY_NUMBER_DECIMAL,
|
|
38
|
+
U_GENERAL_CATEGORY_NUMBER_LETTER,
|
|
39
|
+
U_GENERAL_CATEGORY_NUMBER_OTHER,
|
|
40
|
+
U_GENERAL_CATEGORY_PUNCTUATION_CONNECTOR,
|
|
41
|
+
U_GENERAL_CATEGORY_PUNCTUATION_DASH,
|
|
42
|
+
U_GENERAL_CATEGORY_PUNCTUATION_CLOSE,
|
|
43
|
+
U_GENERAL_CATEGORY_PUNCTUATION_FINAL_QUOTE,
|
|
44
|
+
U_GENERAL_CATEGORY_PUNCTUATION_INITIAL_QUOTE,
|
|
45
|
+
U_GENERAL_CATEGORY_PUNCTUATION_OTHER,
|
|
46
|
+
U_GENERAL_CATEGORY_PUNCTUATION_OPEN,
|
|
47
|
+
U_GENERAL_CATEGORY_SYMBOL_CURRENCY,
|
|
48
|
+
U_GENERAL_CATEGORY_SYMBOL_MODIFIER,
|
|
49
|
+
U_GENERAL_CATEGORY_SYMBOL_MATH,
|
|
50
|
+
U_GENERAL_CATEGORY_SYMBOL_OTHER,
|
|
51
|
+
U_GENERAL_CATEGORY_SEPARATOR_LINE,
|
|
52
|
+
U_GENERAL_CATEGORY_SEPARATOR_PARAGRAPH,
|
|
53
|
+
U_GENERAL_CATEGORY_SEPARATOR_SPACE,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
U_CONST bool u_char_isalnum(uint32_t c);
|
|
57
|
+
U_CONST bool u_char_isalpha(uint32_t c);
|
|
58
|
+
U_CONST bool u_char_isassigned(uint32_t c);
|
|
59
|
+
U_CONST bool u_char_iscased(uint32_t c);
|
|
60
|
+
U_CONST bool u_char_iscaseignorable(uint32_t c);
|
|
61
|
+
U_CONST bool u_char_iscntrl(uint32_t c);
|
|
62
|
+
U_CONST bool u_char_isdefined(uint32_t c);
|
|
63
|
+
U_CONST bool u_char_isdigit(uint32_t c);
|
|
64
|
+
U_CONST bool u_char_isgraph(uint32_t c);
|
|
65
|
+
U_CONST bool u_char_islower(uint32_t c);
|
|
66
|
+
U_CONST bool u_char_isnewline(uint32_t c);
|
|
67
|
+
U_CONST bool u_char_isprint(uint32_t c);
|
|
68
|
+
U_CONST bool u_char_ispunct(uint32_t c);
|
|
69
|
+
U_CONST bool u_char_issoftdotted(uint32_t c);
|
|
70
|
+
U_CONST bool u_char_isspace(uint32_t c);
|
|
71
|
+
U_CONST bool u_char_istitle(uint32_t c);
|
|
72
|
+
U_CONST bool u_char_isupper(uint32_t c);
|
|
73
|
+
U_CONST bool u_char_isvalid(uint32_t c);
|
|
74
|
+
U_CONST bool u_char_iswide(uint32_t c);
|
|
75
|
+
U_CONST bool u_char_iswide_cjk(uint32_t c);
|
|
76
|
+
U_CONST bool u_char_isxdigit(uint32_t c);
|
|
77
|
+
U_CONST bool u_char_iszerowidth(uint32_t c);
|
|
78
|
+
|
|
79
|
+
U_CONST uint32_t u_char_downcase(uint32_t c);
|
|
80
|
+
U_CONST uint32_t u_char_titlecase(uint32_t c);
|
|
81
|
+
U_CONST uint32_t u_char_upcase(uint32_t c);
|
|
82
|
+
|
|
83
|
+
U_CONST size_t u_char_width(uint32_t c);
|
|
84
|
+
|
|
85
|
+
U_CONST int u_char_digit_value(uint32_t c);
|
|
86
|
+
U_CONST int u_char_xdigit_value(uint32_t c);
|
|
87
|
+
|
|
88
|
+
U_CONST enum u_general_category u_char_general_category(uint32_t c);
|
|
89
|
+
|
|
90
|
+
enum u_canonical_combining_class {
|
|
91
|
+
U_CANONICAL_COMBINING_CLASS_NOT_REORDERED = 0,
|
|
92
|
+
U_CANONICAL_COMBINING_CLASS_OVERLAY = 1,
|
|
93
|
+
U_CANONICAL_COMBINING_CLASS_NUKTA = 7,
|
|
94
|
+
U_CANONICAL_COMBINING_CLASS_KANA_VOICING = 8,
|
|
95
|
+
U_CANONICAL_COMBINING_CLASS_VIRAMA = 9,
|
|
96
|
+
U_CANONICAL_COMBINING_CLASS_CCC10 = 10,
|
|
97
|
+
U_CANONICAL_COMBINING_CLASS_CCC11 = 11,
|
|
98
|
+
U_CANONICAL_COMBINING_CLASS_CCC12 = 12,
|
|
99
|
+
U_CANONICAL_COMBINING_CLASS_CCC13 = 13,
|
|
100
|
+
U_CANONICAL_COMBINING_CLASS_CCC14 = 14,
|
|
101
|
+
U_CANONICAL_COMBINING_CLASS_CCC15 = 15,
|
|
102
|
+
U_CANONICAL_COMBINING_CLASS_CCC16 = 16,
|
|
103
|
+
U_CANONICAL_COMBINING_CLASS_CCC17 = 17,
|
|
104
|
+
U_CANONICAL_COMBINING_CLASS_CCC18 = 18,
|
|
105
|
+
U_CANONICAL_COMBINING_CLASS_CCC19 = 19,
|
|
106
|
+
U_CANONICAL_COMBINING_CLASS_CCC20 = 20,
|
|
107
|
+
U_CANONICAL_COMBINING_CLASS_CCC21 = 21,
|
|
108
|
+
U_CANONICAL_COMBINING_CLASS_CCC22 = 22,
|
|
109
|
+
U_CANONICAL_COMBINING_CLASS_CCC23 = 23,
|
|
110
|
+
U_CANONICAL_COMBINING_CLASS_CCC24 = 24,
|
|
111
|
+
U_CANONICAL_COMBINING_CLASS_CCC25 = 25,
|
|
112
|
+
U_CANONICAL_COMBINING_CLASS_CCC26 = 26,
|
|
113
|
+
U_CANONICAL_COMBINING_CLASS_CCC27 = 27,
|
|
114
|
+
U_CANONICAL_COMBINING_CLASS_CCC28 = 28,
|
|
115
|
+
U_CANONICAL_COMBINING_CLASS_CCC29 = 29,
|
|
116
|
+
U_CANONICAL_COMBINING_CLASS_CCC30 = 30,
|
|
117
|
+
U_CANONICAL_COMBINING_CLASS_CCC31 = 31,
|
|
118
|
+
U_CANONICAL_COMBINING_CLASS_CCC32 = 32,
|
|
119
|
+
U_CANONICAL_COMBINING_CLASS_CCC33 = 33,
|
|
120
|
+
U_CANONICAL_COMBINING_CLASS_CCC34 = 34,
|
|
121
|
+
U_CANONICAL_COMBINING_CLASS_CCC35 = 35,
|
|
122
|
+
U_CANONICAL_COMBINING_CLASS_CCC36 = 36,
|
|
123
|
+
U_CANONICAL_COMBINING_CLASS_CCC84 = 84,
|
|
124
|
+
U_CANONICAL_COMBINING_CLASS_CCC91 = 91,
|
|
125
|
+
U_CANONICAL_COMBINING_CLASS_CCC103 = 103,
|
|
126
|
+
U_CANONICAL_COMBINING_CLASS_CCC107 = 107,
|
|
127
|
+
U_CANONICAL_COMBINING_CLASS_CCC118 = 118,
|
|
128
|
+
U_CANONICAL_COMBINING_CLASS_CCC122 = 122,
|
|
129
|
+
U_CANONICAL_COMBINING_CLASS_CCC129 = 129,
|
|
130
|
+
U_CANONICAL_COMBINING_CLASS_CCC130 = 130,
|
|
131
|
+
U_CANONICAL_COMBINING_CLASS_CCC132 = 132,
|
|
132
|
+
U_CANONICAL_COMBINING_CLASS_ATTACHED_BELOW_LEFT = 200,
|
|
133
|
+
U_CANONICAL_COMBINING_CLASS_ATTACHED_BELOW = 202,
|
|
134
|
+
U_CANONICAL_COMBINING_CLASS_ATTACHED_ABOVE = 214,
|
|
135
|
+
U_CANONICAL_COMBINING_CLASS_ATTACHED_ABOVE_RIGHT = 216,
|
|
136
|
+
U_CANONICAL_COMBINING_CLASS_BELOW_LEFT = 218,
|
|
137
|
+
U_CANONICAL_COMBINING_CLASS_BELOW = 220,
|
|
138
|
+
U_CANONICAL_COMBINING_CLASS_BELOW_RIGHT = 222,
|
|
139
|
+
U_CANONICAL_COMBINING_CLASS_LEFT = 224,
|
|
140
|
+
U_CANONICAL_COMBINING_CLASS_RIGHT = 226,
|
|
141
|
+
U_CANONICAL_COMBINING_CLASS_ABOVE_LEFT = 228,
|
|
142
|
+
U_CANONICAL_COMBINING_CLASS_ABOVE = 230,
|
|
143
|
+
U_CANONICAL_COMBINING_CLASS_ABOVE_RIGHT = 232,
|
|
144
|
+
U_CANONICAL_COMBINING_CLASS_DOUBLE_BELOW = 233,
|
|
145
|
+
U_CANONICAL_COMBINING_CLASS_DOUBLE_ABOVE = 234,
|
|
146
|
+
U_CANONICAL_COMBINING_CLASS_IOTA_SUBSCRIPT = 240,
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
U_CONST enum u_canonical_combining_class
|
|
150
|
+
u_char_canonical_combining_class(uint32_t c);
|
|
151
|
+
|
|
152
|
+
uint32_t u_char_mirror(uint32_t c);
|
|
153
|
+
|
|
154
|
+
enum u_line_break {
|
|
155
|
+
U_LINE_BREAK_MANDATORY,
|
|
156
|
+
U_LINE_BREAK_CARRIAGE_RETURN,
|
|
157
|
+
U_LINE_BREAK_LINE_FEED,
|
|
158
|
+
U_LINE_BREAK_COMBINING_MARK,
|
|
159
|
+
U_LINE_BREAK_NEXT_LINE,
|
|
160
|
+
U_LINE_BREAK_SURROGATE,
|
|
161
|
+
U_LINE_BREAK_WORD_JOINER,
|
|
162
|
+
U_LINE_BREAK_ZERO_WIDTH_SPACE,
|
|
163
|
+
U_LINE_BREAK_NON_BREAKING_GLUE,
|
|
164
|
+
U_LINE_BREAK_SPACE,
|
|
165
|
+
U_LINE_BREAK_BREAK_OPPORTUNITY_BEFORE_AND_AFTER,
|
|
166
|
+
U_LINE_BREAK_BREAK_AFTER,
|
|
167
|
+
U_LINE_BREAK_BREAK_BEFORE,
|
|
168
|
+
U_LINE_BREAK_HYPHEN,
|
|
169
|
+
U_LINE_BREAK_CONTINGENT_BREAK_OPPORTUNITY,
|
|
170
|
+
U_LINE_BREAK_CLOSE_PUNCTUATION,
|
|
171
|
+
U_LINE_BREAK_CLOSE_PARENTHESIS,
|
|
172
|
+
U_LINE_BREAK_EXCLAMATION_INTERROGATION,
|
|
173
|
+
U_LINE_BREAK_INSEPARABLE,
|
|
174
|
+
U_LINE_BREAK_NONSTARTER,
|
|
175
|
+
U_LINE_BREAK_OPEN_PUNCTUATION,
|
|
176
|
+
U_LINE_BREAK_QUOTATION,
|
|
177
|
+
U_LINE_BREAK_INFIX_NUMERIC_SEPARATOR,
|
|
178
|
+
U_LINE_BREAK_NUMERIC,
|
|
179
|
+
U_LINE_BREAK_POSTFIX_NUMERIC,
|
|
180
|
+
U_LINE_BREAK_PREFIX_NUMERIC,
|
|
181
|
+
U_LINE_BREAK_SYMBOLS_ALLOWING_BREAK_AFTER,
|
|
182
|
+
U_LINE_BREAK_AMBIGUOUS,
|
|
183
|
+
U_LINE_BREAK_ALPHABETIC,
|
|
184
|
+
U_LINE_BREAK_CONDITIONAL_JAPANESE_STARTER,
|
|
185
|
+
U_LINE_BREAK_HANGUL_LV_SYLLABLE,
|
|
186
|
+
U_LINE_BREAK_HANGUL_LVT_SYLLABLE,
|
|
187
|
+
U_LINE_BREAK_HEBREW_LETTER,
|
|
188
|
+
U_LINE_BREAK_IDEOGRAPHIC,
|
|
189
|
+
U_LINE_BREAK_HANGUL_L_JAMO,
|
|
190
|
+
U_LINE_BREAK_HANGUL_V_JAMO,
|
|
191
|
+
U_LINE_BREAK_HANGUL_T_JAMO,
|
|
192
|
+
U_LINE_BREAK_REGIONAL_INDICATOR,
|
|
193
|
+
U_LINE_BREAK_COMPLEX_CONTEXT_DEPENDENT,
|
|
194
|
+
U_LINE_BREAK_UNKNOWN,
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
U_CONST enum u_line_break u_char_line_break(uint32_t c);
|
|
198
|
+
|
|
199
|
+
enum u_grapheme_break {
|
|
200
|
+
U_GRAPHEME_BREAK_CONTROL,
|
|
201
|
+
U_GRAPHEME_BREAK_CR,
|
|
202
|
+
U_GRAPHEME_BREAK_EXTEND,
|
|
203
|
+
U_GRAPHEME_BREAK_L,
|
|
204
|
+
U_GRAPHEME_BREAK_LF,
|
|
205
|
+
U_GRAPHEME_BREAK_LV,
|
|
206
|
+
U_GRAPHEME_BREAK_LVT,
|
|
207
|
+
U_GRAPHEME_BREAK_OTHER,
|
|
208
|
+
U_GRAPHEME_BREAK_PREPEND,
|
|
209
|
+
U_GRAPHEME_BREAK_REGIONAL_INDICATOR,
|
|
210
|
+
U_GRAPHEME_BREAK_SPACINGMARK,
|
|
211
|
+
U_GRAPHEME_BREAK_T,
|
|
212
|
+
U_GRAPHEME_BREAK_V,
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
U_CONST enum u_grapheme_break u_char_grapheme_break(uint32_t c);
|
|
216
|
+
|
|
217
|
+
enum u_word_break {
|
|
218
|
+
U_WORD_BREAK_ALETTER,
|
|
219
|
+
U_WORD_BREAK_CR,
|
|
220
|
+
U_WORD_BREAK_EXTEND,
|
|
221
|
+
U_WORD_BREAK_EXTENDNUMLET,
|
|
222
|
+
U_WORD_BREAK_FORMAT,
|
|
223
|
+
U_WORD_BREAK_KATAKANA,
|
|
224
|
+
U_WORD_BREAK_LF,
|
|
225
|
+
U_WORD_BREAK_MIDLETTER,
|
|
226
|
+
U_WORD_BREAK_MIDNUM,
|
|
227
|
+
U_WORD_BREAK_MIDNUMLET,
|
|
228
|
+
U_WORD_BREAK_NEWLINE,
|
|
229
|
+
U_WORD_BREAK_NUMERIC,
|
|
230
|
+
U_WORD_BREAK_OTHER,
|
|
231
|
+
U_WORD_BREAK_REGIONAL_INDICATOR,
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
U_CONST enum u_word_break u_char_word_break(uint32_t c);
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
enum u_script {
|
|
238
|
+
U_SCRIPT_COMMON,
|
|
239
|
+
U_SCRIPT_INHERITED,
|
|
240
|
+
U_SCRIPT_ARABIC,
|
|
241
|
+
U_SCRIPT_ARMENIAN,
|
|
242
|
+
U_SCRIPT_BENGALI,
|
|
243
|
+
U_SCRIPT_BOPOMOFO,
|
|
244
|
+
U_SCRIPT_CHEROKEE,
|
|
245
|
+
U_SCRIPT_COPTIC,
|
|
246
|
+
U_SCRIPT_CYRILLIC,
|
|
247
|
+
U_SCRIPT_DESERET,
|
|
248
|
+
U_SCRIPT_DEVANAGARI,
|
|
249
|
+
U_SCRIPT_ETHIOPIC,
|
|
250
|
+
U_SCRIPT_GEORGIAN,
|
|
251
|
+
U_SCRIPT_GOTHIC,
|
|
252
|
+
U_SCRIPT_GREEK,
|
|
253
|
+
U_SCRIPT_GUJARATI,
|
|
254
|
+
U_SCRIPT_GURMUKHI,
|
|
255
|
+
U_SCRIPT_HAN,
|
|
256
|
+
U_SCRIPT_HANGUL,
|
|
257
|
+
U_SCRIPT_HEBREW,
|
|
258
|
+
U_SCRIPT_HIRAGANA,
|
|
259
|
+
U_SCRIPT_KANNADA,
|
|
260
|
+
U_SCRIPT_KATAKANA,
|
|
261
|
+
U_SCRIPT_KHMER,
|
|
262
|
+
U_SCRIPT_LAO,
|
|
263
|
+
U_SCRIPT_LATIN,
|
|
264
|
+
U_SCRIPT_MALAYALAM,
|
|
265
|
+
U_SCRIPT_MONGOLIAN,
|
|
266
|
+
U_SCRIPT_MYANMAR,
|
|
267
|
+
U_SCRIPT_OGHAM,
|
|
268
|
+
U_SCRIPT_OLD_ITALIC,
|
|
269
|
+
U_SCRIPT_ORIYA,
|
|
270
|
+
U_SCRIPT_RUNIC,
|
|
271
|
+
U_SCRIPT_SINHALA,
|
|
272
|
+
U_SCRIPT_SYRIAC,
|
|
273
|
+
U_SCRIPT_TAMIL,
|
|
274
|
+
U_SCRIPT_TELUGU,
|
|
275
|
+
U_SCRIPT_THAANA,
|
|
276
|
+
U_SCRIPT_THAI,
|
|
277
|
+
U_SCRIPT_TIBETAN,
|
|
278
|
+
U_SCRIPT_CANADIAN_ABORIGINAL,
|
|
279
|
+
U_SCRIPT_YI,
|
|
280
|
+
U_SCRIPT_TAGALOG,
|
|
281
|
+
U_SCRIPT_HANUNOO,
|
|
282
|
+
U_SCRIPT_BUHID,
|
|
283
|
+
U_SCRIPT_TAGBANWA,
|
|
284
|
+
U_SCRIPT_BRAILLE,
|
|
285
|
+
U_SCRIPT_CYPRIOT,
|
|
286
|
+
U_SCRIPT_LIMBU,
|
|
287
|
+
U_SCRIPT_OSMANYA,
|
|
288
|
+
U_SCRIPT_SHAVIAN,
|
|
289
|
+
U_SCRIPT_LINEAR_B,
|
|
290
|
+
U_SCRIPT_TAI_LE,
|
|
291
|
+
U_SCRIPT_UGARITIC,
|
|
292
|
+
U_SCRIPT_NEW_TAI_LUE,
|
|
293
|
+
U_SCRIPT_BUGINESE,
|
|
294
|
+
U_SCRIPT_GLAGOLITIC,
|
|
295
|
+
U_SCRIPT_TIFINAGH,
|
|
296
|
+
U_SCRIPT_SYLOTI_NAGRI,
|
|
297
|
+
U_SCRIPT_OLD_PERSIAN,
|
|
298
|
+
U_SCRIPT_KHAROSHTHI,
|
|
299
|
+
U_SCRIPT_UNKNOWN,
|
|
300
|
+
U_SCRIPT_BALINESE,
|
|
301
|
+
U_SCRIPT_CUNEIFORM,
|
|
302
|
+
U_SCRIPT_PHOENICIAN,
|
|
303
|
+
U_SCRIPT_PHAGS_PA,
|
|
304
|
+
U_SCRIPT_NKO,
|
|
305
|
+
U_SCRIPT_KAYAH_LI,
|
|
306
|
+
U_SCRIPT_LEPCHA,
|
|
307
|
+
U_SCRIPT_REJANG,
|
|
308
|
+
U_SCRIPT_SUNDANESE,
|
|
309
|
+
U_SCRIPT_SAURASHTRA,
|
|
310
|
+
U_SCRIPT_CHAM,
|
|
311
|
+
U_SCRIPT_OL_CHIKI,
|
|
312
|
+
U_SCRIPT_VAI,
|
|
313
|
+
U_SCRIPT_CARIAN,
|
|
314
|
+
U_SCRIPT_LYCIAN,
|
|
315
|
+
U_SCRIPT_LYDIAN,
|
|
316
|
+
U_SCRIPT_AVESTAN,
|
|
317
|
+
U_SCRIPT_BAMUM,
|
|
318
|
+
U_SCRIPT_EGYPTIAN_HIEROGLYPHS,
|
|
319
|
+
U_SCRIPT_IMPERIAL_ARAMAIC,
|
|
320
|
+
U_SCRIPT_INSCRIPTIONAL_PAHLAVI,
|
|
321
|
+
U_SCRIPT_INSCRIPTIONAL_PARTHIAN,
|
|
322
|
+
U_SCRIPT_JAVANESE,
|
|
323
|
+
U_SCRIPT_KAITHI,
|
|
324
|
+
U_SCRIPT_LISU,
|
|
325
|
+
U_SCRIPT_MEETEI_MAYEK,
|
|
326
|
+
U_SCRIPT_OLD_SOUTH_ARABIAN,
|
|
327
|
+
U_SCRIPT_OLD_TURKIC,
|
|
328
|
+
U_SCRIPT_SAMARITAN,
|
|
329
|
+
U_SCRIPT_TAI_THAM,
|
|
330
|
+
U_SCRIPT_TAI_VIET,
|
|
331
|
+
U_SCRIPT_BATAK,
|
|
332
|
+
U_SCRIPT_BRAHMI,
|
|
333
|
+
U_SCRIPT_MANDAIC,
|
|
334
|
+
U_SCRIPT_MEROITIC_HIEROGLYPHS,
|
|
335
|
+
U_SCRIPT_MEROITIC_CURSIVE,
|
|
336
|
+
U_SCRIPT_SORA_SOMPENG,
|
|
337
|
+
U_SCRIPT_CHAKMA,
|
|
338
|
+
U_SCRIPT_SHARADA,
|
|
339
|
+
U_SCRIPT_TAKRI,
|
|
340
|
+
U_SCRIPT_MIAO,
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
U_CONST enum u_script u_char_script(uint32_t c);
|
|
344
|
+
|
|
345
|
+
enum u_normalization_form {
|
|
346
|
+
U_NORMALIZATION_FORM_D,
|
|
347
|
+
U_NORMALIZATION_FORM_C,
|
|
348
|
+
U_NORMALIZATION_FORM_KD,
|
|
349
|
+
U_NORMALIZATION_FORM_KC,
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
size_t u_normalize(char *restrict result, size_t m,
|
|
353
|
+
const char *restrict u, size_t n,
|
|
354
|
+
enum u_normalization_form form) U_NON_NULL((3));
|
|
355
|
+
|
|
356
|
+
enum u_normalized {
|
|
357
|
+
U_NORMALIZED_YES,
|
|
358
|
+
U_NORMALIZED_NO,
|
|
359
|
+
U_NORMALIZED_MAYBE,
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
enum u_normalized u_char_normalized(uint32_t c, enum u_normalization_form form);
|
|
363
|
+
enum u_normalized u_normalized(const char *u, size_t n,
|
|
364
|
+
enum u_normalization_form form) U_NON_NULL((1));
|
|
365
|
+
|
|
366
|
+
size_t u_downcase(char *restrict result, size_t m,
|
|
367
|
+
const char *restrict u, size_t n,
|
|
368
|
+
const char *restrict locale) U_NON_NULL((3));
|
|
369
|
+
|
|
370
|
+
size_t u_foldcase(char *restrict result, size_t m,
|
|
371
|
+
const char *restrict string, size_t n,
|
|
372
|
+
const char *restrict locale) U_NON_NULL((3));
|
|
373
|
+
|
|
374
|
+
size_t u_titlecase(char *restrict result, size_t m,
|
|
375
|
+
const char *restrict string, size_t n,
|
|
376
|
+
const char *restrict locale) U_NON_NULL((3));
|
|
377
|
+
|
|
378
|
+
size_t u_upcase(char *restrict result, size_t m,
|
|
379
|
+
const char *restrict string, size_t n,
|
|
380
|
+
const char *restrict locale) U_NON_NULL((3));
|
|
381
|
+
|
|
382
|
+
size_t u_mirror(char *restrict result, size_t m,
|
|
383
|
+
const char *restrict u, size_t n) U_NON_NULL((3));
|
|
384
|
+
|
|
385
|
+
size_t u_recode(char *restrict result, size_t m,
|
|
386
|
+
const char *restrict string, size_t n,
|
|
387
|
+
const char *restrict codeset) U_NON_NULL((3, 5));
|
|
388
|
+
|
|
389
|
+
extern const char * const u_skip_lengths;
|
|
390
|
+
|
|
391
|
+
#define u_next(str) ((str) + u_skip_lengths[*(const unsigned char *)(str)])
|
|
392
|
+
|
|
393
|
+
uint32_t u_decode(const char **q, const char *u, const char *end)
|
|
394
|
+
U_NON_NULL((1, 2, 3));
|
|
395
|
+
int u_decode_n(uint32_t *result, const char *u, size_t n)
|
|
396
|
+
U_NON_NULL((1, 2));
|
|
397
|
+
uint32_t u_decode_r(const char **p, const char *begin, const char *u);
|
|
398
|
+
|
|
399
|
+
U_PURE char *u_offset_to_pointer(const char *str, long offset) U_NON_NULL((1));
|
|
400
|
+
U_PURE char *u_offset_to_pointer_n(const char *str, long offset, size_t n)
|
|
401
|
+
U_NON_NULL((1));
|
|
402
|
+
|
|
403
|
+
U_PURE long u_pointer_to_offset(const char *str, const char *pos)
|
|
404
|
+
U_NON_NULL((1, 2));
|
|
405
|
+
|
|
406
|
+
U_PURE int u_collate(const char *a, size_t a_n, const char *b, size_t b_n,
|
|
407
|
+
const char *locale) U_NON_NULL((1, 3));
|
|
408
|
+
size_t u_collation_key(char *restrict result, size_t m,
|
|
409
|
+
const char *restrict string, size_t n,
|
|
410
|
+
const char *restrict locale) U_NON_NULL((3));
|
|
411
|
+
size_t u_normalized_collation_key(char *restrict result, size_t m,
|
|
412
|
+
const char *restrict string, size_t n,
|
|
413
|
+
const char *restrict locale) U_NON_NULL((3));
|
|
414
|
+
|
|
415
|
+
U_PURE size_t u_char_index(const char *str, uint32_t c) U_NON_NULL((1));
|
|
416
|
+
U_PURE size_t u_char_index_n(const char *str, uint32_t c, size_t n)
|
|
417
|
+
U_NON_NULL((1));
|
|
418
|
+
U_PURE size_t u_index(const char *haystack, const char *needle)
|
|
419
|
+
U_NON_NULL((1, 2));
|
|
420
|
+
U_PURE size_t u_index_n(const char *haystack, const char *needle, size_t n)
|
|
421
|
+
U_NON_NULL((1, 2));
|
|
422
|
+
|
|
423
|
+
U_PURE size_t u_char_rindex(const char *str, uint32_t c) U_NON_NULL((1));
|
|
424
|
+
U_PURE size_t u_char_rindex_n(const char *str, uint32_t c, size_t n)
|
|
425
|
+
U_NON_NULL((1));
|
|
426
|
+
U_PURE size_t u_rindex(const char *haystack, const char *needle)
|
|
427
|
+
U_NON_NULL((1, 2));
|
|
428
|
+
U_PURE size_t u_rindex_n(const char *haystack, const char *needle, size_t n)
|
|
429
|
+
U_NON_NULL((1, 2));
|
|
430
|
+
|
|
431
|
+
U_PURE bool u_has_prefix(const char *str, const char *prefix)
|
|
432
|
+
U_NON_NULL((1, 2));
|
|
433
|
+
|
|
434
|
+
bool u_valid(const char *restrict u, size_t n, const char **restrict end)
|
|
435
|
+
U_NON_NULL((1));
|
|
436
|
+
|
|
437
|
+
U_PURE bool u_is_ascii_only(const char *string) U_NON_NULL((1));
|
|
438
|
+
U_PURE bool u_is_ascii_only_n(const char *string, size_t n) U_NON_NULL((1));
|
|
439
|
+
|
|
440
|
+
U_PURE size_t u_n_chars(const char *str) U_NON_NULL((1));
|
|
441
|
+
U_PURE size_t u_n_chars_n(const char *str, size_t n) U_NON_NULL((1));
|
|
442
|
+
|
|
443
|
+
U_PURE size_t u_width(const char *string) U_NON_NULL((1));
|
|
444
|
+
U_PURE size_t u_width_n(const char *string, size_t n) U_NON_NULL((1));
|
|
445
|
+
|
|
446
|
+
U_PURE size_t u_n_bytes(const char *str) U_NON_NULL((1));
|
|
447
|
+
|
|
448
|
+
size_t u_reverse(char *restrict result, size_t m,
|
|
449
|
+
const char *restrict string, size_t n) U_NON_NULL((3));
|
|
450
|
+
|
|
451
|
+
typedef void (*u_substring_fn)(const char *, size_t, void *);
|
|
452
|
+
void u_words(const char *string, size_t n, u_substring_fn fn, void *closure)
|
|
453
|
+
U_NON_NULL((1));
|
|
454
|
+
void u_grapheme_clusters(const char *string, size_t n, u_substring_fn fn,
|
|
455
|
+
void *closure) U_NON_NULL((1));
|
|
456
|
+
|
|
457
|
+
int u_char_to_u_n(uint32_t c, char *result, size_t n);
|
|
458
|
+
int u_char_to_u(uint32_t c, char *result);
|