u 0.5.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/ext/u/depend
ADDED
@@ -0,0 +1,281 @@
|
|
1
|
+
attributes.o: attributes.c u.h private.h data/constants.h \
|
2
|
+
data/attributes.h attributes.h
|
3
|
+
private.o: private.c u.h private.h
|
4
|
+
rb_private.o: rb_private.c rb_includes.h extconf.h u.h private.h \
|
5
|
+
rb_private.h rb_u_string.h
|
6
|
+
rb_u.o: rb_u.c u.h private.h rb_private.h rb_u_buffer.h rb_u_string.h
|
7
|
+
rb_u_buffer.o: rb_u_buffer.c u.h private.h rb_private.h rb_u_buffer.h \
|
8
|
+
rb_u_string.h
|
9
|
+
rb_u_re.o: rb_u_re.c u.h private.h rb_private.h rb_u_re.h
|
10
|
+
rb_u_string.o: rb_u_string.c u.h private.h rb_private.h rb_u_string.h
|
11
|
+
rb_u_string_alnum.o: rb_u_string_alnum.c rb_includes.h extconf.h u.h \
|
12
|
+
private.h rb_private.h rb_u_string.h
|
13
|
+
rb_u_string_alpha.o: rb_u_string_alpha.c rb_includes.h extconf.h u.h \
|
14
|
+
private.h rb_private.h rb_u_string.h
|
15
|
+
rb_u_string_aref.o: rb_u_string_aref.c rb_includes.h extconf.h u.h \
|
16
|
+
private.h rb_private.h rb_u_string.h rb_u_re.h
|
17
|
+
rb_u_string_ascii_only.o: rb_u_string_ascii_only.c rb_includes.h \
|
18
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h
|
19
|
+
rb_u_string_assigned.o: rb_u_string_assigned.c rb_includes.h extconf.h \
|
20
|
+
u.h private.h rb_private.h rb_u_string.h
|
21
|
+
rb_u_string_b.o: rb_u_string_b.c rb_includes.h extconf.h u.h private.h \
|
22
|
+
rb_private.h rb_u_string.h
|
23
|
+
rb_u_string_bytesize.o: rb_u_string_bytesize.c rb_includes.h extconf.h \
|
24
|
+
u.h private.h rb_private.h rb_u_string.h
|
25
|
+
rb_u_string_byteslice.o: rb_u_string_byteslice.c rb_includes.h extconf.h \
|
26
|
+
u.h private.h rb_private.h rb_u_string.h
|
27
|
+
rb_u_string_canonical_combining_class.o: \
|
28
|
+
rb_u_string_canonical_combining_class.c rb_includes.h extconf.h u.h \
|
29
|
+
private.h rb_private.h rb_u_string.h
|
30
|
+
rb_u_string_case_ignorable.o: rb_u_string_case_ignorable.c rb_includes.h \
|
31
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h
|
32
|
+
rb_u_string_casecmp.o: rb_u_string_casecmp.c rb_includes.h extconf.h u.h \
|
33
|
+
private.h rb_private.h rb_u_string.h
|
34
|
+
rb_u_string_cased.o: rb_u_string_cased.c rb_includes.h extconf.h u.h \
|
35
|
+
private.h rb_private.h rb_u_string.h
|
36
|
+
rb_u_string_chomp.o: rb_u_string_chomp.c rb_includes.h extconf.h u.h \
|
37
|
+
private.h rb_private.h rb_u_string.h
|
38
|
+
rb_u_string_chop.o: rb_u_string_chop.c rb_includes.h extconf.h u.h \
|
39
|
+
private.h rb_private.h rb_u_string.h
|
40
|
+
rb_u_string_chr.o: rb_u_string_chr.c rb_includes.h extconf.h u.h \
|
41
|
+
private.h rb_private.h rb_u_string.h
|
42
|
+
rb_u_string_cntrl.o: rb_u_string_cntrl.c rb_includes.h extconf.h u.h \
|
43
|
+
private.h rb_private.h rb_u_string.h
|
44
|
+
rb_u_string_collate.o: rb_u_string_collate.c rb_includes.h extconf.h u.h \
|
45
|
+
private.h rb_private.h rb_u_string.h
|
46
|
+
rb_u_string_collation_key.o: rb_u_string_collation_key.c rb_includes.h \
|
47
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h
|
48
|
+
rb_u_string_count.o: rb_u_string_count.c rb_includes.h extconf.h u.h \
|
49
|
+
private.h rb_private.h rb_u_string.h rb_u_string_internal_tr.h
|
50
|
+
rb_u_string_defined.o: rb_u_string_defined.c rb_includes.h extconf.h u.h \
|
51
|
+
private.h rb_private.h rb_u_string.h
|
52
|
+
rb_u_string_delete.o: rb_u_string_delete.c rb_includes.h extconf.h u.h \
|
53
|
+
private.h rb_private.h rb_u_string.h rb_u_string_internal_tr.h
|
54
|
+
rb_u_string_digit.o: rb_u_string_digit.c rb_includes.h extconf.h u.h \
|
55
|
+
private.h rb_private.h rb_u_string.h
|
56
|
+
rb_u_string_downcase.o: rb_u_string_downcase.c rb_includes.h extconf.h \
|
57
|
+
u.h private.h rb_private.h rb_u_string.h
|
58
|
+
rb_u_string_dump.o: rb_u_string_dump.c rb_includes.h extconf.h u.h \
|
59
|
+
private.h rb_private.h rb_u_string.h rb_u_buffer.h
|
60
|
+
rb_u_string_each_byte.o: rb_u_string_each_byte.c rb_includes.h extconf.h \
|
61
|
+
u.h private.h rb_private.h rb_u_string.h yield.h
|
62
|
+
rb_u_string_each_char.o: rb_u_string_each_char.c rb_includes.h extconf.h \
|
63
|
+
u.h private.h rb_private.h rb_u_string.h yield.h
|
64
|
+
rb_u_string_each_codepoint.o: rb_u_string_each_codepoint.c rb_includes.h \
|
65
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h yield.h
|
66
|
+
rb_u_string_each_grapheme_cluster.o: rb_u_string_each_grapheme_cluster.c \
|
67
|
+
rb_includes.h extconf.h u.h private.h rb_private.h rb_u_string.h
|
68
|
+
rb_u_string_each_line.o: rb_u_string_each_line.c rb_includes.h extconf.h \
|
69
|
+
u.h private.h rb_private.h rb_u_string.h yield.h
|
70
|
+
rb_u_string_each_word.o: rb_u_string_each_word.c rb_includes.h extconf.h \
|
71
|
+
u.h private.h rb_private.h rb_u_string.h
|
72
|
+
rb_u_string_empty.o: rb_u_string_empty.c rb_includes.h extconf.h u.h \
|
73
|
+
private.h rb_private.h rb_u_string.h
|
74
|
+
rb_u_string_end_with.o: rb_u_string_end_with.c rb_includes.h extconf.h \
|
75
|
+
u.h private.h rb_private.h rb_u_string.h
|
76
|
+
rb_u_string_eql.o: rb_u_string_eql.c rb_includes.h extconf.h u.h \
|
77
|
+
private.h rb_private.h rb_u_string.h
|
78
|
+
rb_u_string_equal.o: rb_u_string_equal.c rb_includes.h extconf.h u.h \
|
79
|
+
private.h rb_private.h rb_u_string.h
|
80
|
+
rb_u_string_foldcase.o: rb_u_string_foldcase.c rb_includes.h extconf.h \
|
81
|
+
u.h private.h rb_private.h rb_u_string.h
|
82
|
+
rb_u_string_folded.o: rb_u_string_folded.c rb_includes.h extconf.h u.h \
|
83
|
+
private.h rb_private.h rb_u_string.h
|
84
|
+
rb_u_string_format.o: rb_u_string_format.c rb_includes.h extconf.h u.h \
|
85
|
+
private.h rb_private.h rb_u_string.h rb_u_buffer.h \
|
86
|
+
rb_u_string_to_inum.h
|
87
|
+
rb_u_string_general_category.o: rb_u_string_general_category.c \
|
88
|
+
rb_includes.h extconf.h u.h private.h rb_private.h rb_u_string.h
|
89
|
+
rb_u_string_getbyte.o: rb_u_string_getbyte.c rb_includes.h extconf.h u.h \
|
90
|
+
private.h rb_private.h rb_u_string.h
|
91
|
+
rb_u_string_graph.o: rb_u_string_graph.c rb_includes.h extconf.h u.h \
|
92
|
+
private.h rb_private.h rb_u_string.h
|
93
|
+
rb_u_string_grapheme_break.o: rb_u_string_grapheme_break.c rb_includes.h \
|
94
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h
|
95
|
+
rb_u_string_gsub.o: rb_u_string_gsub.c rb_includes.h extconf.h u.h \
|
96
|
+
private.h rb_private.h rb_u_string.h rb_u_re.h
|
97
|
+
rb_u_string_hash.o: rb_u_string_hash.c rb_includes.h extconf.h u.h \
|
98
|
+
private.h rb_private.h rb_u_string.h
|
99
|
+
rb_u_string_hex.o: rb_u_string_hex.c rb_includes.h extconf.h u.h \
|
100
|
+
private.h rb_private.h rb_u_string.h rb_u_string_to_inum.h
|
101
|
+
rb_u_string_include.o: rb_u_string_include.c rb_includes.h extconf.h u.h \
|
102
|
+
private.h rb_private.h rb_u_string.h
|
103
|
+
rb_u_string_index.o: rb_u_string_index.c rb_includes.h extconf.h u.h \
|
104
|
+
private.h rb_private.h rb_u_string.h rb_u_re.h
|
105
|
+
rb_u_string_inspect.o: rb_u_string_inspect.c rb_includes.h extconf.h u.h \
|
106
|
+
private.h rb_private.h rb_u_string.h
|
107
|
+
rb_u_string_internal_tr.o: rb_u_string_internal_tr.c rb_includes.h \
|
108
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h \
|
109
|
+
rb_u_string_internal_tr.h
|
110
|
+
rb_u_string_justify.o: rb_u_string_justify.c rb_includes.h extconf.h u.h \
|
111
|
+
private.h rb_private.h rb_u_string.h
|
112
|
+
rb_u_string_length.o: rb_u_string_length.c rb_includes.h extconf.h u.h \
|
113
|
+
private.h rb_private.h rb_u_string.h
|
114
|
+
rb_u_string_line_break.o: rb_u_string_line_break.c rb_includes.h \
|
115
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h
|
116
|
+
rb_u_string_lower.o: rb_u_string_lower.c rb_includes.h extconf.h u.h \
|
117
|
+
private.h rb_private.h rb_u_string.h
|
118
|
+
rb_u_string_lstrip.o: rb_u_string_lstrip.c rb_includes.h extconf.h u.h \
|
119
|
+
private.h rb_private.h rb_u_string.h
|
120
|
+
rb_u_string_match.o: rb_u_string_match.c rb_includes.h extconf.h u.h \
|
121
|
+
private.h rb_private.h rb_u_string.h rb_u_re.h
|
122
|
+
rb_u_string_mirror.o: rb_u_string_mirror.c rb_includes.h extconf.h u.h \
|
123
|
+
private.h rb_private.h rb_u_string.h
|
124
|
+
rb_u_string_newline.o: rb_u_string_newline.c rb_includes.h extconf.h u.h \
|
125
|
+
private.h rb_private.h rb_u_string.h
|
126
|
+
rb_u_string_normalize.o: rb_u_string_normalize.c rb_includes.h extconf.h \
|
127
|
+
u.h private.h rb_private.h rb_u_string.h
|
128
|
+
rb_u_string_normalized.o: rb_u_string_normalized.c rb_includes.h \
|
129
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h
|
130
|
+
rb_u_string_oct.o: rb_u_string_oct.c rb_includes.h extconf.h u.h \
|
131
|
+
private.h rb_private.h rb_u_string.h rb_u_string_to_inum.h
|
132
|
+
rb_u_string_ord.o: rb_u_string_ord.c rb_includes.h extconf.h u.h \
|
133
|
+
private.h rb_private.h rb_u_string.h
|
134
|
+
rb_u_string_partition.o: rb_u_string_partition.c rb_includes.h extconf.h \
|
135
|
+
u.h private.h rb_private.h rb_u_string.h rb_u_re.h
|
136
|
+
rb_u_string_plus.o: rb_u_string_plus.c rb_includes.h extconf.h u.h \
|
137
|
+
private.h rb_private.h rb_u_string.h
|
138
|
+
rb_u_string_print.o: rb_u_string_print.c rb_includes.h extconf.h u.h \
|
139
|
+
private.h rb_private.h rb_u_string.h
|
140
|
+
rb_u_string_punct.o: rb_u_string_punct.c rb_includes.h extconf.h u.h \
|
141
|
+
private.h rb_private.h rb_u_string.h
|
142
|
+
rb_u_string_reverse.o: rb_u_string_reverse.c rb_includes.h extconf.h u.h \
|
143
|
+
private.h rb_private.h rb_u_string.h
|
144
|
+
rb_u_string_rindex.o: rb_u_string_rindex.c rb_includes.h extconf.h u.h \
|
145
|
+
private.h rb_private.h rb_u_string.h
|
146
|
+
rb_u_string_rpartition.o: rb_u_string_rpartition.c rb_includes.h \
|
147
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h rb_u_re.h
|
148
|
+
rb_u_string_rstrip.o: rb_u_string_rstrip.c rb_includes.h extconf.h u.h \
|
149
|
+
private.h rb_private.h rb_u_string.h
|
150
|
+
rb_u_string_scan.o: rb_u_string_scan.c rb_includes.h extconf.h u.h \
|
151
|
+
private.h rb_private.h rb_u_string.h rb_u_re.h
|
152
|
+
rb_u_string_script.o: rb_u_string_script.c rb_includes.h extconf.h u.h \
|
153
|
+
private.h rb_private.h rb_u_string.h
|
154
|
+
rb_u_string_soft_dotted.o: rb_u_string_soft_dotted.c rb_includes.h \
|
155
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h
|
156
|
+
rb_u_string_space.o: rb_u_string_space.c rb_includes.h extconf.h u.h \
|
157
|
+
private.h rb_private.h rb_u_string.h
|
158
|
+
rb_u_string_split.o: rb_u_string_split.c rb_includes.h extconf.h u.h \
|
159
|
+
private.h rb_private.h rb_u_string.h rb_u_re.h
|
160
|
+
rb_u_string_squeeze.o: rb_u_string_squeeze.c rb_includes.h extconf.h u.h \
|
161
|
+
private.h rb_private.h rb_u_string.h rb_u_string_internal_tr.h
|
162
|
+
rb_u_string_start_with.o: rb_u_string_start_with.c rb_includes.h \
|
163
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h
|
164
|
+
rb_u_string_strip.o: rb_u_string_strip.c rb_includes.h extconf.h u.h \
|
165
|
+
private.h rb_private.h rb_u_string.h
|
166
|
+
rb_u_string_sub.o: rb_u_string_sub.c rb_includes.h extconf.h u.h \
|
167
|
+
private.h rb_private.h rb_u_string.h rb_u_re.h
|
168
|
+
rb_u_string_times.o: rb_u_string_times.c rb_includes.h extconf.h u.h \
|
169
|
+
private.h rb_private.h rb_u_string.h
|
170
|
+
rb_u_string_title.o: rb_u_string_title.c rb_includes.h extconf.h u.h \
|
171
|
+
private.h rb_private.h rb_u_string.h
|
172
|
+
rb_u_string_titlecase.o: rb_u_string_titlecase.c rb_includes.h extconf.h \
|
173
|
+
u.h private.h rb_private.h rb_u_string.h
|
174
|
+
rb_u_string_to_i.o: rb_u_string_to_i.c rb_includes.h extconf.h u.h \
|
175
|
+
private.h rb_private.h rb_u_string.h rb_u_string_to_inum.h
|
176
|
+
rb_u_string_to_inum.o: rb_u_string_to_inum.c rb_includes.h extconf.h u.h \
|
177
|
+
private.h rb_private.h rb_u_string.h rb_u_string_to_inum.h
|
178
|
+
rb_u_string_to_str.o: rb_u_string_to_str.c rb_includes.h extconf.h u.h \
|
179
|
+
private.h rb_private.h rb_u_string.h
|
180
|
+
rb_u_string_to_sym.o: rb_u_string_to_sym.c rb_includes.h extconf.h u.h \
|
181
|
+
private.h rb_private.h rb_u_string.h
|
182
|
+
rb_u_string_tr.o: rb_u_string_tr.c rb_includes.h extconf.h u.h private.h \
|
183
|
+
rb_private.h rb_u_string.h rb_u_string_internal_tr.h output.h
|
184
|
+
rb_u_string_upcase.o: rb_u_string_upcase.c rb_includes.h extconf.h u.h \
|
185
|
+
private.h rb_private.h rb_u_string.h
|
186
|
+
rb_u_string_upper.o: rb_u_string_upper.c rb_includes.h extconf.h u.h \
|
187
|
+
private.h rb_private.h rb_u_string.h
|
188
|
+
rb_u_string_valid.o: rb_u_string_valid.c rb_includes.h extconf.h u.h \
|
189
|
+
private.h rb_private.h rb_u_string.h
|
190
|
+
rb_u_string_valid_encoding.o: rb_u_string_valid_encoding.c rb_includes.h \
|
191
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h
|
192
|
+
rb_u_string_wide.o: rb_u_string_wide.c rb_includes.h extconf.h u.h \
|
193
|
+
private.h rb_private.h rb_u_string.h
|
194
|
+
rb_u_string_wide_cjk.o: rb_u_string_wide_cjk.c rb_includes.h extconf.h \
|
195
|
+
u.h private.h rb_private.h rb_u_string.h
|
196
|
+
rb_u_string_width.o: rb_u_string_width.c rb_includes.h extconf.h u.h \
|
197
|
+
private.h rb_private.h rb_u_string.h
|
198
|
+
rb_u_string_word_break.o: rb_u_string_word_break.c rb_includes.h \
|
199
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h
|
200
|
+
rb_u_string_xdigit.o: rb_u_string_xdigit.c rb_includes.h extconf.h u.h \
|
201
|
+
private.h rb_private.h rb_u_string.h
|
202
|
+
rb_u_string_zero_width.o: rb_u_string_zero_width.c rb_includes.h \
|
203
|
+
extconf.h u.h private.h rb_private.h rb_u_string.h
|
204
|
+
titled.o: titled.c u.h private.h data/constants.h data/title-table.h \
|
205
|
+
titled.h
|
206
|
+
u.o: u.c u.h
|
207
|
+
u_char_canonical_combining_class.o: u_char_canonical_combining_class.c \
|
208
|
+
u.h private.h data/constants.h data/canonical-combining-class.h
|
209
|
+
u_char_digit_value.o: u_char_digit_value.c u.h private.h data/constants.h \
|
210
|
+
attributes.h
|
211
|
+
u_char_downcase.o: u_char_downcase.c u.h private.h data/constants.h \
|
212
|
+
attributes.h titled.h
|
213
|
+
u_char_general_category.o: u_char_general_category.c u.h private.h \
|
214
|
+
data/constants.h data/general-category.h
|
215
|
+
u_char_grapheme_break.o: u_char_grapheme_break.c u.h private.h \
|
216
|
+
data/constants.h data/grapheme-break.h
|
217
|
+
u_char_isalnum.o: u_char_isalnum.c u.h private.h
|
218
|
+
u_char_isalpha.o: u_char_isalpha.c u.h private.h
|
219
|
+
u_char_isassigned.o: u_char_isassigned.c u.h private.h
|
220
|
+
u_char_iscased.o: u_char_iscased.c u.h private.h data/constants.h \
|
221
|
+
data/cased.h
|
222
|
+
u_char_iscaseignorable.o: u_char_iscaseignorable.c u.h private.h
|
223
|
+
u_char_iscntrl.o: u_char_iscntrl.c u.h private.h
|
224
|
+
u_char_isdefined.o: u_char_isdefined.c u.h private.h
|
225
|
+
u_char_isdigit.o: u_char_isdigit.c u.h private.h
|
226
|
+
u_char_isgraph.o: u_char_isgraph.c u.h private.h
|
227
|
+
u_char_islower.o: u_char_islower.c u.h private.h
|
228
|
+
u_char_isnewline.o: u_char_isnewline.c u.h
|
229
|
+
u_char_isprint.o: u_char_isprint.c u.h private.h
|
230
|
+
u_char_ispunct.o: u_char_ispunct.c u.h private.h
|
231
|
+
u_char_issoftdotted.o: u_char_issoftdotted.c u.h private.h \
|
232
|
+
data/constants.h data/soft-dotted.h
|
233
|
+
u_char_isspace.o: u_char_isspace.c u.h private.h
|
234
|
+
u_char_isupper.o: u_char_isupper.c u.h private.h
|
235
|
+
u_char_isvalid.o: u_char_isvalid.c u.h
|
236
|
+
u_char_iswide.o: u_char_iswide.c u.h private.h data/wide.h
|
237
|
+
u_char_iswide_cjk.o: u_char_iswide_cjk.c u.h private.h data/wide-cjk.h
|
238
|
+
u_char_isxdigit.o: u_char_isxdigit.c u.h private.h
|
239
|
+
u_char_iszerowidth.o: u_char_iszerowidth.c u.h private.h
|
240
|
+
u_char_line_break.o: u_char_line_break.c u.h data/constants.h \
|
241
|
+
data/line-break.h private.h
|
242
|
+
u_char_mirror.o: u_char_mirror.c u.h private.h data/bidi-mirroring.h
|
243
|
+
u_char_normalized.o: u_char_normalized.c u.h data/constants.h \
|
244
|
+
data/normalization-quick-check.h
|
245
|
+
u_char_script.o: u_char_script.c u.h private.h data/script.h
|
246
|
+
u_char_to_u.o: u_char_to_u.c u.h
|
247
|
+
u_char_upcase.o: u_char_upcase.c u.h private.h data/constants.h \
|
248
|
+
attributes.h titled.h
|
249
|
+
u_char_width.o: u_char_width.c u.h
|
250
|
+
u_char_word_break.o: u_char_word_break.c u.h private.h data/constants.h \
|
251
|
+
data/word-break.h
|
252
|
+
u_char_xdigit_value.o: u_char_xdigit_value.c u.h private.h
|
253
|
+
u_collate.o: u_collate.c extconf.h u.h private.h
|
254
|
+
u_collation_key.o: u_collation_key.c extconf.h u.h private.h
|
255
|
+
u_decode.o: u_decode.c u.h private.h
|
256
|
+
u_downcase.o: u_downcase.c u.h private.h data/constants.h attributes.h \
|
257
|
+
titled.h output.h u_locale.h case.h
|
258
|
+
u_foldcase.o: u_foldcase.c u.h private.h data/case-folding.h output.h \
|
259
|
+
u_locale.h
|
260
|
+
u_grapheme_clusters.o: u_grapheme_clusters.c u.h private.h
|
261
|
+
u_has_prefix.o: u_has_prefix.c u.h private.h
|
262
|
+
u_index.o: u_index.c u.h private.h
|
263
|
+
u_is_ascii_only.o: u_is_ascii_only.c u.h private.h
|
264
|
+
u_locale.o: u_locale.c u.h u_locale.h private.h
|
265
|
+
u_mirror.o: u_mirror.c u.h private.h output.h
|
266
|
+
u_n_bytes.o: u_n_bytes.c u.h private.h
|
267
|
+
u_n_chars.o: u_n_chars.c u.h private.h
|
268
|
+
u_normalize.o: u_normalize.c u.h private.h data/constants.h \
|
269
|
+
data/decompose.h data/compose.h output.h
|
270
|
+
u_normalized.o: u_normalized.c u.h
|
271
|
+
u_offset_to_pointer.o: u_offset_to_pointer.c u.h private.h
|
272
|
+
u_pointer_to_offset.o: u_pointer_to_offset.c u.h private.h
|
273
|
+
u_recode.o: u_recode.c extconf.h u.h
|
274
|
+
u_reverse.o: u_reverse.c u.h private.h output.h
|
275
|
+
u_rindex.o: u_rindex.c u.h private.h
|
276
|
+
u_titlecase.o: u_titlecase.c u.h private.h data/constants.h attributes.h \
|
277
|
+
titled.h output.h u_locale.h case.h
|
278
|
+
u_upcase.o: u_upcase.c u.h private.h data/constants.h attributes.h \
|
279
|
+
titled.h output.h u_locale.h case.h
|
280
|
+
u_width.o: u_width.c u.h private.h
|
281
|
+
u_words.o: u_words.c u.h private.h
|
data/ext/u/extconf.rb
ADDED
@@ -0,0 +1,158 @@
|
|
1
|
+
require 'mkmf'
|
2
|
+
require 'optparse'
|
3
|
+
|
4
|
+
$CFLAGS = $CFLAGS.sub('$(cflags) ', '')
|
5
|
+
|
6
|
+
have_header 'assert.h'
|
7
|
+
have_header 'limits.h'
|
8
|
+
have_header 'locale.h'
|
9
|
+
have_header 'stdarg.h'
|
10
|
+
have_header 'stdbool.h'
|
11
|
+
have_header 'stddef.h'
|
12
|
+
have_header 'stdint.h'
|
13
|
+
have_header 'stdio.h'
|
14
|
+
have_header 'stdlib.h'
|
15
|
+
have_header 'string.h'
|
16
|
+
have_header 'sys/types.h'
|
17
|
+
have_header 'locale.h'
|
18
|
+
$xlocale_h = have_header('xlocale.h')
|
19
|
+
|
20
|
+
checking_for 'broken RMATCH_REGS' do
|
21
|
+
$defs.push '-DHAVE_BROKEN_RMATCH_REGS' unless try_compile <<EOC
|
22
|
+
#include <ruby.h>
|
23
|
+
#ifdef HAVE_RUBY_RE_H
|
24
|
+
# include <ruby/re.h>
|
25
|
+
#else
|
26
|
+
# include <re.h>
|
27
|
+
#endif
|
28
|
+
int
|
29
|
+
main(void)
|
30
|
+
{
|
31
|
+
struct re_registers *registers = RMATCH_REGS(Qnil);
|
32
|
+
struct re_registers *registers2 = registers;
|
33
|
+
registers = registers2;
|
34
|
+
return 0;
|
35
|
+
}
|
36
|
+
EOC
|
37
|
+
end
|
38
|
+
|
39
|
+
$defs.push '-D__USE_XOPEN2K'
|
40
|
+
$defs.push '-D__USE_XOPEN2K8'
|
41
|
+
|
42
|
+
headers = []
|
43
|
+
headers << 'xlocale.h' if $xlocale_h
|
44
|
+
have_func 'strcoll_l', headers
|
45
|
+
have_func 'strxfrm_l', headers
|
46
|
+
|
47
|
+
checking_for 'nl_langinfo and CODESET' do
|
48
|
+
$defs.push '-DHAVE_NL_LANGINFO_CODESET' if try_compile <<EOC
|
49
|
+
#include <langinfo.h>
|
50
|
+
int
|
51
|
+
main(void)
|
52
|
+
{
|
53
|
+
char *cs = nl_langinfo(CODESET);
|
54
|
+
return 0;
|
55
|
+
}
|
56
|
+
EOC
|
57
|
+
end
|
58
|
+
have_func 'nl_langinfo_l', %w'langinfo.h' + headers
|
59
|
+
have_library 'iconv', 'iconv', 'iconv.h'
|
60
|
+
have_func 'iconv', 'iconv.h'
|
61
|
+
|
62
|
+
have_func 'rb_errinfo', 'ruby.h'
|
63
|
+
have_func 'rb_long2int', 'ruby.h'
|
64
|
+
have_func 'rb_hash_lookup2', 'ruby.h'
|
65
|
+
have_func 'rb_reg_backref_number', 'ruby.h'
|
66
|
+
have_func 'rb_memhash', 'ruby.h'
|
67
|
+
checking_for 'number of arguments to rb_reg_regsub' do
|
68
|
+
$defs.push '-DHAVE_RB_REG_REGSUB4' if try_compile <<EOC
|
69
|
+
#include <ruby.h>
|
70
|
+
#ifdef HAVE_RUBY_RE_H
|
71
|
+
# include <ruby/re.h>
|
72
|
+
#else
|
73
|
+
# include <re.h>
|
74
|
+
#endif
|
75
|
+
int
|
76
|
+
main(void)
|
77
|
+
{
|
78
|
+
rb_reg_regsub(Qnil, Qnil, NULL, Qnil);
|
79
|
+
return 0;
|
80
|
+
}
|
81
|
+
EOC
|
82
|
+
end
|
83
|
+
have_func 'rb_vsprintf', 'ruby.h'
|
84
|
+
|
85
|
+
have_var 'rb_eKeyError', 'ruby.h'
|
86
|
+
|
87
|
+
$enable_gcc_warnings = false
|
88
|
+
OptionParser.new{ |opts|
|
89
|
+
opts.banner = 'Usage: ruby extconf.rb [OPTION]...'
|
90
|
+
|
91
|
+
opts.on '--enable-gcc-warnings', 'turn on lots of GCC warnings' do
|
92
|
+
$enable_gcc_warnings = true
|
93
|
+
end
|
94
|
+
|
95
|
+
opts.on '--disable-gcc-warnings', 'turn off lots of GCC warnings' do
|
96
|
+
$enable_gcc_warnings = false
|
97
|
+
end
|
98
|
+
}.parse!
|
99
|
+
|
100
|
+
def try_compiler_option(opt, &block)
|
101
|
+
result = false
|
102
|
+
checking_for "#{opt} option to compiler" do
|
103
|
+
$CFLAGS += " #{opt}" if result = try_cpp('', opt, &block)
|
104
|
+
end
|
105
|
+
result
|
106
|
+
end
|
107
|
+
|
108
|
+
try_compiler_option '-std=c99'
|
109
|
+
try_compiler_option '-finline-functions'
|
110
|
+
try_compiler_option '-fno-common'
|
111
|
+
try_compiler_option '-fvisibility=hidden'
|
112
|
+
|
113
|
+
if $enable_gcc_warnings
|
114
|
+
try_compiler_option '-Werror'
|
115
|
+
try_compiler_option '-Wall'
|
116
|
+
try_compiler_option '-Waggregate-return'
|
117
|
+
try_compiler_option '-Wcast-align'
|
118
|
+
try_compiler_option '-Wextra'
|
119
|
+
try_compiler_option '-Wformat=2'
|
120
|
+
try_compiler_option '-Winit-self'
|
121
|
+
try_compiler_option '-Winline'
|
122
|
+
try_compiler_option '-Wmissing-declarations'
|
123
|
+
try_compiler_option '-Wmissing-format-attribute'
|
124
|
+
try_compiler_option '-Wmissing-include-dirs'
|
125
|
+
try_compiler_option '-Wmissing-noreturn'
|
126
|
+
try_compiler_option '-Wmissing-prototypes'
|
127
|
+
try_compiler_option '-Wnested-externs'
|
128
|
+
try_compiler_option '-Wold-style-definition'
|
129
|
+
try_compiler_option '-Wpacked'
|
130
|
+
try_compiler_option '-Wp,-D_FORTIFY_SOURCE=2'
|
131
|
+
try_compiler_option '-Wpointer-arith'
|
132
|
+
try_compiler_option '-Wsign-compare'
|
133
|
+
try_compiler_option '-Wstrict-aliasing=2'
|
134
|
+
# try_compiler_option '-Wsuggest-attribute=const'
|
135
|
+
try_compiler_option '-Wsuggest-attribute=noreturn'
|
136
|
+
# try_compiler_option '-Wsuggest-attribute=pure'
|
137
|
+
try_compiler_option '-Wundef'
|
138
|
+
try_compiler_option '-Wunsafe-loop-optimizations'
|
139
|
+
try_compiler_option '-Wwrite-strings'
|
140
|
+
try_compiler_option '-Wshorten-64-to-32' unless RUBY_VERSION < '1.9'
|
141
|
+
end
|
142
|
+
|
143
|
+
$defs.push '-DU_COMPILATION'
|
144
|
+
|
145
|
+
create_header
|
146
|
+
create_makefile 'u/u'
|
147
|
+
File.open('Makefile', 'ab') do |f|
|
148
|
+
f.puts <<EOF
|
149
|
+
TAGS: $(SRCS)
|
150
|
+
ctags -f $@ -I UNUSED,HIDDEN,_ $^
|
151
|
+
|
152
|
+
tags: TAGS
|
153
|
+
|
154
|
+
.PHONY: tags
|
155
|
+
|
156
|
+
DISTCLEANFILES += TAGS
|
157
|
+
EOF
|
158
|
+
end
|
data/ext/u/output.h
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
#ifndef UNIT
|
2
|
+
# define UNIT char
|
3
|
+
# define UNIT_TO_U u_char_to_u_n
|
4
|
+
# define UNIT_N_BYTES u_n_bytes
|
5
|
+
#endif
|
6
|
+
|
7
|
+
struct output {
|
8
|
+
UNIT *result;
|
9
|
+
size_t m;
|
10
|
+
size_t n;
|
11
|
+
};
|
12
|
+
|
13
|
+
#define OUTPUT_INIT(result, m) { result, m, 0 }
|
14
|
+
|
15
|
+
static inline struct output *
|
16
|
+
output_char(struct output *output, uint32_t c)
|
17
|
+
{
|
18
|
+
output->n += UNIT_TO_U(c,
|
19
|
+
output->result != NULL ?
|
20
|
+
output->result + output->n :
|
21
|
+
NULL,
|
22
|
+
output->m > output->n ?
|
23
|
+
output->m - output->n - 1 :
|
24
|
+
0);
|
25
|
+
return output;
|
26
|
+
}
|
27
|
+
|
28
|
+
#ifdef UNIT_N_BYTES
|
29
|
+
static inline struct output *
|
30
|
+
output_string(struct output *output, const UNIT *string, size_t n)
|
31
|
+
{
|
32
|
+
if (output->m > output->n + n)
|
33
|
+
memcpy(output->result + output->n, string, sizeof(UNIT) * n);
|
34
|
+
output->n += n;
|
35
|
+
return output;
|
36
|
+
}
|
37
|
+
|
38
|
+
static inline struct output *
|
39
|
+
output_zstring(struct output *output, const UNIT *string)
|
40
|
+
{
|
41
|
+
return output_string(output, string, UNIT_N_BYTES(string));
|
42
|
+
}
|
43
|
+
#endif
|
44
|
+
|
45
|
+
static inline size_t
|
46
|
+
output_finalize(struct output *output)
|
47
|
+
{
|
48
|
+
if (output->m > output->n)
|
49
|
+
output->result[output->n] = '\0';
|
50
|
+
return output->n;
|
51
|
+
}
|